Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace momentjs with alternative #131

Comments

@webketje
Copy link
Member

Luxon looks good (also for multilang-localized dates especially) https://moment.github.io/luxon

@webketje
Copy link
Member Author

webketje commented Jan 3, 2023

Further thinking of this, given permalinks maps the date part to folder structures, there's only half or so of the formatting at the table at https://momentjs.com/docs/#/displaying/format/ that should be allowed. All the formats containing + or : or undesirable as they clash with either folder allowed chars or url-recognized chars.

99% of use cases will use either inverted ISO-like format 2022/01/01 or with some parts in full, eg archive/2022/january.
Luxon unfortunately relies on the Intl API which is not guaranteed to be available in all Node builds (regardless of version).
So the best way forward may be to provide our own limited set of formatting tokens (compatible with moment.js)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment