diff options
| author | Fuwn <[email protected]> | 2025-02-28 04:30:15 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-02-28 04:30:15 -0800 |
| commit | c311207683dfca40353ed5ba403bb1f718c1e543 (patch) | |
| tree | accf8a28ceb7a522dda07cb5ba4143fa8e0b8e30 /src/lib/Tools | |
| parent | style: Run formatter (diff) | |
| download | due.moe-c311207683dfca40353ed5ba403bb1f718c1e543.tar.xz due.moe-c311207683dfca40353ed5ba403bb1f718c1e543.zip | |
fix(Birthdays): Always allow leap year day values
Diffstat (limited to 'src/lib/Tools')
| -rw-r--r-- | src/lib/Tools/Birthdays.svelte | 4 | ||||
| -rw-r--r-- | src/lib/Tools/BirthdaysTemplate.svelte | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/Tools/Birthdays.svelte b/src/lib/Tools/Birthdays.svelte index 97ff40d8..519e1550 100644 --- a/src/lib/Tools/Birthdays.svelte +++ b/src/lib/Tools/Birthdays.svelte @@ -26,7 +26,7 @@ $: { month = Math.min(month, 12); month = Math.max(month, 1); - day = Math.min(day, new Date(new Date().getFullYear(), month, 0).getDate()); + day = Math.min(day, new Date(2024, month, 0).getDate()); day = Math.max(day, 1); if (browser) anisearchBirthdays = aniSearchBirthdays(month, day); @@ -115,7 +115,7 @@ </select> <select bind:value={day}> - {#each Array.from({ length: new Date(new Date().getFullYear(), month, 0).getDate() }, (_, i) => i + 1) as day} + {#each Array.from({ length: new Date(2024, month, 0).getDate() }, (_, i) => i + 1) as day} <option value={day}>{day}</option> {/each} </select> diff --git a/src/lib/Tools/BirthdaysTemplate.svelte b/src/lib/Tools/BirthdaysTemplate.svelte index 4e2f0755..951de5cf 100644 --- a/src/lib/Tools/BirthdaysTemplate.svelte +++ b/src/lib/Tools/BirthdaysTemplate.svelte @@ -19,7 +19,7 @@ $: { month = Math.min(month, 12); month = Math.max(month, 1); - day = Math.min(day, new Date(new Date().getFullYear(), month, 0).getDate()); + day = Math.min(day, new Date(2024, month, 0).getDate()); day = Math.max(day, 1); if (browser) { @@ -57,7 +57,7 @@ </select> <select bind:value={day}> - {#each Array.from({ length: new Date(new Date().getFullYear(), month, 0).getDate() }, (_, i) => i + 1) as day} + {#each Array.from({ length: new Date(2024, month, 0).getDate() }, (_, i) => i + 1) as day} <option value={day}>{day}</option> {/each} </select> |