From e9b08b773d1793593ebc836c85f0f0a4c8ce561e Mon Sep 17 00:00:00 2001 From: Spectralitree <72747870+Spectralitree@users.noreply.github.com> Date: Thu, 30 Dec 2021 10:24:00 +0100 Subject: [PATCH] fix: fix birthday parsing --- src/lib/member/Body.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/member/Body.svelte b/src/lib/member/Body.svelte index 5a899cb0..186a9bf4 100644 --- a/src/lib/member/Body.svelte +++ b/src/lib/member/Body.svelte @@ -46,8 +46,12 @@ let created = moment(member.created).format("MMM D, YYYY"); let birthday: string; - if (member.birthday) birthday = moment(member.birthday).format("MMM D, YYYY"); + $: {member.birthday; + if (member.birthday) birthday = moment(member.birthday, "YYYY-MM-DD").format("MMM D, YYYY"); + } + $: trimmedBirthday = birthday && birthday.endsWith(', 0004') ? trimmedBirthday = birthday.replace(', 0004', '') : birthday; + @@ -75,7 +79,7 @@ {/if} {#if member.birthday} - Birthday: {birthday} + Birthday: {trimmedBirthday} {/if} {#if member.created}