Here's my attempt at #42: a SolidJS component FormatDate that can render as an absolute date, absolute datetime or a relative time ago. I've replaced all usage of TimeAgo with it, and also updated MatchPreview to use it.
I've got one annoyign bug hanging around - when using a non-relative format, the rendered HTML is not updating currently when hydrating on the client - the UTC times just hang around forever. The console.log debugging call I've got in there is outputting what I expect on the client, so the code is definitely running; it's just not rendering correctly for some reason.
This is my first time touching both Astro and SolidJS so I figured I'd ask for help rather than spend any more time banging my head against it - there's clearly something I don't understand either in how the SSR hydration works, or just how SolidJS works. Also open to any other feedback :)
Here's my attempt at #42: a SolidJS component FormatDate that can render as an absolute date, absolute datetime or a relative time ago. I've replaced all usage of TimeAgo with it, and also updated MatchPreview to use it.
I've got one annoyign bug hanging around - when using a non-relative format, the rendered HTML is not updating currently when hydrating on the client - the UTC times just hang around forever. The
console.log
debugging call I've got in there is outputting what I expect on the client, so the code is definitely running; it's just not rendering correctly for some reason.This is my first time touching both Astro and SolidJS so I figured I'd ask for help rather than spend any more time banging my head against it - there's clearly something I don't understand either in how the SSR hydration works, or just how SolidJS works. Also open to any other feedback :)