From bba5e58fba0956cad39cd6516fc00cd4173384a2 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 1 Jul 2023 20:46:13 -0700 Subject: [PATCH] feat: :sparkles: celebrate on calendar when birthday --- packages/client/src/widgets/calendar.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/client/src/widgets/calendar.vue b/packages/client/src/widgets/calendar.vue index 655308d50..1377b44bf 100644 --- a/packages/client/src/widgets/calendar.vue +++ b/packages/client/src/widgets/calendar.vue @@ -5,7 +5,7 @@ {{ i18n.t("yearX", { year }) }} {{ i18n.t("monthX", { month }) }}

-

+

🎉{{ i18n.t("dayX", { day }) }}🎉 { const now = new Date(); const nd = now.getDate(); @@ -121,6 +125,13 @@ const tick = () => { yearP.value = (yearNumer / yearDenom) * 100; isHoliday.value = now.getDay() === 0 || now.getDay() === 6; + + if (hasBirthday) { + const [bdayYear, bdayMonth, bdayDay] = $i.birthday.split("-"); + if (month.value === +bdayMonth && day.value == +bdayDay) { + isBirthday.value = true; + } + } }; useInterval(tick, 1000, {