Skip to content

Commit

Permalink
fix: correct update time to UTC-5 00:00
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Dec 3, 2022
1 parent 95e2544 commit 3e6aae2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/views/selectDayView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ export class SelectDayView {
this.provider.refresh();
this.date = new Date();
},
new Date(
this.date.getFullYear(),
this.date.getMonth(),
this.date.getDate() + 1,
new Date(Date.UTC(
this.date.getUTCFullYear(),
this.date.getUTCMonth(),
this.date.getUTCDate() + (this.date.getUTCHours() < 5 ? 0 : 1), // if not yet 5 o'clock use current day, else take next day
5, // `UTC-5 00:00` => `UTC 05:00`
0,
0,
0,
10
).getTime() - this.date.getTime(),
10 // placeholder / safety time
)).getTime() - this.date.getTime(),
);
}

Expand Down

0 comments on commit 3e6aae2

Please sign in to comment.