Skip to content

Commit

Permalink
feat: add current time when add academic notice
Browse files Browse the repository at this point in the history
  • Loading branch information
2paperstar committed Nov 28, 2023
1 parent 4860365 commit a54658b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import dayjs from 'dayjs';
import timezone from 'dayjs/plugin/timezone';
import utc from 'dayjs/plugin/utc';

dayjs.tz.setDefault('Asia/Seoul');
dayjs.extend(utc);
dayjs.extend(timezone);
5 changes: 4 additions & 1 deletion src/notice/notice.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,10 @@ export class NoticeService {
tags: tags.map(({ id }) => id),
},
user.uuid,
dayjs(meta.createdAt).tz('Asia/Seoul').toDate(),
dayjs(meta.createdAt)
.tz()
.add(dayjs().tz().startOf('d').diff(dayjs().tz()))
.toDate(),
);
await this.sendNoticeToAllUsers(meta.title, [], result);
}),
Expand Down

0 comments on commit a54658b

Please sign in to comment.