Skip to content

Commit 3e75de8

Browse files
committed
adds more strict check on time calculation
1 parent 3829b53 commit 3e75de8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/progresses.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const progressesCollection = fireStore.collection("progresses");
1616
const getProgressDateTimestamp = () => {
1717
// Currently, we are primarily catering to Indian users for our apps, which is why we have implemented support for the IST (Indian Standard Time) timezone for progress updates.
1818
const currentHourIST = new Date().getUTCHours() + 5.5; // IST offset is UTC+5:30;
19-
const isBefore6amIST = currentHourIST < 6;
19+
const isBefore6amIST = currentHourIST === 5.5 && new Date().getUTCMinutes() <= 30;
2020
return isBefore6amIST ? new Date().setUTCHours(0, 0, 0, 0) - MILLISECONDS_IN_DAY : new Date().setUTCHours(0, 0, 0, 0);
2121
};
2222

0 commit comments

Comments
 (0)