removed unneccesary files
This commit is contained in:
@@ -40,27 +40,28 @@ function calculateNextDueDateLikeServer(
|
||||
|
||||
switch (frequency) {
|
||||
case "weekly":
|
||||
zoned.setUTCDate(zoned.getUTCDate() + 7);
|
||||
zoned.setDate(zoned.getDate() + 7);
|
||||
break;
|
||||
case "biweekly":
|
||||
zoned.setUTCDate(zoned.getUTCDate() + 14);
|
||||
zoned.setDate(zoned.getDate() + 14);
|
||||
break;
|
||||
case "monthly": {
|
||||
const targetDay = zoned.getUTCDate();
|
||||
const nextMonth = zoned.getUTCMonth() + 1;
|
||||
const nextYear = zoned.getUTCFullYear() + Math.floor(nextMonth / 12);
|
||||
const nextMonthIndex = nextMonth % 12;
|
||||
const targetDay = zoned.getDate();
|
||||
zoned.setDate(1);
|
||||
zoned.setMonth(zoned.getMonth() + 1);
|
||||
const lastDay = new Date(
|
||||
Date.UTC(nextYear, nextMonthIndex + 1, 0)
|
||||
).getUTCDate();
|
||||
zoned.setUTCFullYear(nextYear, nextMonthIndex, Math.min(targetDay, lastDay));
|
||||
zoned.getFullYear(),
|
||||
zoned.getMonth() + 1,
|
||||
0
|
||||
).getDate();
|
||||
zoned.setDate(Math.min(targetDay, lastDay));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return base;
|
||||
}
|
||||
|
||||
zoned.setUTCHours(0, 0, 0, 0);
|
||||
zoned.setHours(0, 0, 0, 0);
|
||||
return fromZonedTime(zoned, timezone);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user