fixed payout locks & time sensitive todos & minor ui updates on chores view
This commit is contained in:
+10
@@ -57,6 +57,16 @@ export function weekStart(payday: number, tz: string): string {
|
||||
return addDaysStr(today, -back);
|
||||
}
|
||||
|
||||
// The first configured-payday day strictly after dateStr (used to gate
|
||||
// payday-settled bonus rewards). Weekly: periodEnd (weekStart+6) → next payday.
|
||||
export function nextPaydayAfter(dateStr: string, payday: number, tz: string): string {
|
||||
let d = addDaysStr(dateStr, 1);
|
||||
while (weekdayInTz(new Date(d + "T12:00:00Z"), tz) !== payday) {
|
||||
d = addDaysStr(d, 1);
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
function monthStartStr(): string {
|
||||
const d = new Date();
|
||||
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-01`;
|
||||
|
||||
Reference in New Issue
Block a user