created a variable that stores yesterDay's utcoffset (#12860)

passed this variable in shouldDo function call as timezoneUtcoffset
shouldDo takes timezoneUtcoffset into account when running yesterday's dailies, which fixes DST mismatch issues
This commit is contained in:
Iffat Saiyara
2021-04-30 16:21:43 -04:00
committed by GitHub
parent 3d7d7e034f
commit 4d7304ab8d

View File

@@ -765,10 +765,12 @@ export default {
hours: this.user.preferences.dayStart, hours: this.user.preferences.dayStart,
}); });
const yesterUtcOffset = yesterDay.utcOffset();
dailys.forEach(task => { dailys.forEach(task => {
if (task && task.group.approval && task.group.approval.requested) return; if (task && task.group.approval && task.group.approval.requested) return;
if (task.completed) return; if (task.completed) return;
const due = shouldDo(yesterDay, task); const due = shouldDo(yesterDay, task, { timezoneUtcOffset: yesterUtcOffset });
if (task.yesterDaily && due) this.yesterDailies.push(task); if (task.yesterDaily && due) this.yesterDailies.push(task);
}); });