File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
packages/velog-cron/src/services/StatsService Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -43,17 +43,19 @@ export class StatsService implements Service {
43
43
)
44
44
}
45
45
public async weekly ( ) {
46
- const start = startOfWeek ( subWeeks ( new Date ( ) , 1 ) , { weekStartsOn : 1 } ) // 월요일부터 시작
47
- const end = endOfWeek ( subWeeks ( new Date ( ) , 1 ) )
46
+ const oneWeekAgo = subWeeks ( new Date ( ) , 1 )
47
+ const start = startOfWeek ( oneWeekAgo , { weekStartsOn : 1 } ) // 월요일부터 시작
48
+ const end = endOfWeek ( oneWeekAgo , { weekStartsOn : 1 } )
48
49
49
50
const usersCount = await this . getUsersCount ( start , end )
50
51
const postCount = await this . getPostsCount ( start , end )
51
52
53
+ const timeFormat = 'yyyy-MM-dd HH:mm:ss'
52
54
await this . discord . sendMessage (
53
55
'stats' ,
54
- `[Weekly ]\n기간: ${ format (
55
- start ,
56
- 'yyyy-MM-dd ' ,
56
+ `[Daily ]\n기간: ${ format ( start , timeFormat ) } - ${ format (
57
+ end ,
58
+ 'HH:mm:ss ' ,
57
59
) } \n${ usersCount } 명의 사용자가 가입했습니다.\n${ postCount } 개의 공개 포스트가 작성되었습니다.`,
58
60
)
59
61
}
You can’t perform that action at this time.
0 commit comments