Fix the end of shift function

This commit is contained in:
2025-09-11 18:14:08 -05:00
parent 2be923f635
commit dde9cd7eae

View File

@@ -349,11 +349,11 @@ export const endOfShiftUpdate = action({
const hour = now.getHours(); const hour = now.getHours();
const minute = now.getMinutes(); const minute = now.getMinutes();
if (day == 0 || day === 6) return; if (day == 0 || day === 6) return;
if (hour === 12) { if (hour === 5) {
await ctx.runMutation(api.statuses.updateAllStatuses, { await ctx.runMutation(api.statuses.updateAllStatuses, {
message: 'End of shift', message: 'End of shift',
}); });
} else if (hour === 11) { } else if (hour === 4) {
const ms = ((60 - minute) % 60) * 60 * 1000; const ms = ((60 - minute) % 60) * 60 * 1000;
await ctx.scheduler.runAfter(ms, api.statuses.endOfShiftUpdate); await ctx.scheduler.runAfter(ms, api.statuses.endOfShiftUpdate);
} else return; } else return;