Skip to content

Commit

Permalink
Fix time offset calculation in HomeService
Browse files Browse the repository at this point in the history
  • Loading branch information
overthestream committed Dec 19, 2023
1 parent db5c54a commit 43a5b0f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/home/home.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ export class HomeService {
});
let seconds = -1;
if (user.group) {
const timeOffset = new Date().getTime() - user.group.createdAt.getTime();
const timeOffset =
new Date().getTime() +
9 * 60 * 60 * 1000 -
user.group.createdAt.getTime();
seconds = 8 * 60 * 60 * 1000 - (timeOffset % (8 * 60 * 60 * 1000));
}
const chats = await this.chattingModel.find();
Expand Down

0 comments on commit 43a5b0f

Please sign in to comment.