Closed dennistobar closed 3 years ago
Since moment.js is officially "done" now and not being maintained anymore - this might be a good reason to look into an alternative.
I would love to go for the non dependency approach and use Intl from JavaScript, but this would limit the usage of displaying localized time past (10 seconds ago, 5 minutes ago, ...).
I might need to look into different libraries.
Thanks alot for your contribution!
Yes, I saw the same the past week on Reddit (yes, I'm read Reddit for some news!). The Momentjs devs suggest some libraries or "just raw Intl API". For the case "10 seconds ago" it's a bad idea use Intl, except if you will want to create a function to calculate (really bad idea).
In other project, I see date-fns as replacement and it was really cool.
Yeah, I already had a headache just thinking about doing that with the Intl API 😅
date-fns really looks promising! Surprised I never heard of it...
Hi, I just write some lines to test the format times and how to use unixtimestamp in the code. See my test commit. Remember, I know enough TS/JS to read, but not to write fluently :)
Can you create a test PR with that commit for a preview environment?
Done in #98
@dennistobar I think it will be a good move to replace momentjs with date-fns 👍
I created an issue #99 if you are interested to work on it and give writing Javascript with Svelte a go ;-)
Nice to hear, I'll work on it :+1:
Closed thanks to @dennistobar
Describe the bug Is a minor issue. With i18n, the displayed datetime is wrong localized. It shows MMMM Do YYYY, h:mm a. in Spanish it produces Septiembre 28° 2020 9:20 am.
To Reproduce Steps to reproduce the behavior:
Expected behavior See a localized datetime: in Spanish should be "28 de septiembre de 2020 09:20 am" (maybe LLL in Moment js)
Screenshots
Desktop (please complete the following information):