Fix the end of shift function
This commit is contained in:
@@ -349,11 +349,11 @@ export const endOfShiftUpdate = action({
|
||||
const hour = now.getHours();
|
||||
const minute = now.getMinutes();
|
||||
if (day == 0 || day === 6) return;
|
||||
if (hour === 12) {
|
||||
if (hour === 5) {
|
||||
await ctx.runMutation(api.statuses.updateAllStatuses, {
|
||||
message: 'End of shift',
|
||||
});
|
||||
} else if (hour === 11) {
|
||||
} else if (hour === 4) {
|
||||
const ms = ((60 - minute) % 60) * 60 * 1000;
|
||||
await ctx.scheduler.runAfter(ms, api.statuses.endOfShiftUpdate);
|
||||
} else return;
|
||||
|
Reference in New Issue
Block a user