From 327a5ff77ad8f4100ae48a4429e78195710a9ad2 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Thu, 29 Feb 2024 02:55:21 -0800
Subject: fix(birthdays): leap year

---
 src/lib/Tools/Birthdays.svelte | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/lib/Tools/Birthdays.svelte')

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>
-- 
cgit v1.2.3

