diff options
| author | Fuwn <[email protected]> | 2024-02-29 02:55:21 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-02-29 02:55:21 -0800 |
| commit | 327a5ff77ad8f4100ae48a4429e78195710a9ad2 (patch) | |
| tree | ff4d4d2e028949155ecf5e1ec1fb20ba3f3bdccd /src/lib/Tools | |
| parent | fix(user): show hololive when not authenticated (diff) | |
| download | due.moe-327a5ff77ad8f4100ae48a4429e78195710a9ad2.tar.xz due.moe-327a5ff77ad8f4100ae48a4429e78195710a9ad2.zip | |
fix(birthdays): leap year
Diffstat (limited to 'src/lib/Tools')
| -rw-r--r-- | src/lib/Tools/Birthdays.svelte | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/Tools/Birthdays.svelte b/src/lib/Tools/Birthdays.svelte index 070abeda..462b660a 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(0, month, 0).getDate()); + day = Math.min(day, new Date(new Date().getFullYear(), month, 0).getDate()); day = Math.max(day, 1); if (browser) anisearchBirthdays = aniSearchBirthdays(month, day); @@ -109,7 +109,7 @@ </select> <select bind:value={day}> - {#each Array.from({ length: new Date(0, month, 0).getDate() }, (_, i) => i + 1) as day} + {#each Array.from({ length: new Date(new Date().getFullYear(), month, 0).getDate() }, (_, i) => i + 1) as day} <option value={day}>{day}</option> {/each} </select> |