We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2d4c93 commit f6fb28cCopy full SHA for f6fb28c
1 file changed
src/ui.ts
@@ -49,10 +49,15 @@ export async function buildSockView(
49
50
const latestWakaData = await getLatestWakaData(slackId);
51
52
+ const adjustedNowTimestamp = Date.now() + (tz_offset ?? 0) * 1000;
53
+ const adjustedStartTimestamp =
54
+ eventStartDate.getTime() + (tz_offset ?? 0) * 1000;
55
+ const adjustedEndTimestamp = eventEndDate.getTime() + (tz_offset ?? 0) * 1000;
56
+
57
let rn =
- Date.now() < eventStartDate.getTime()
- ? eventStartDate.getTime() - Date.now()
- : eventEndDate.getTime() - Date.now();
58
+ adjustedNowTimestamp < adjustedStartTimestamp
59
+ ? adjustedStartTimestamp - adjustedNowTimestamp
60
+ : adjustedEndTimestamp - adjustedNowTimestamp;
61
62
let days = Math.floor(rn / (86400 * 1000));
63
rn -= days * (86400 * 1000);
0 commit comments