iamkun / iamkun/dayjs

Consider using Intl api

Open
#498 24 comments 36 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

I really like the way Luxon does localization and time zone support by using Intl.DateTimeFormat

For time zones, it allows the user to specify any time zone without any extra files to download compared to solutions for other libraries that are quite large. See [their timezone docs](https://github.com/moment/luxon/blob/master/docs/zones.md) and [code](https://github.com/moment/luxon/tree/master/src/zones) for more details. This could be a possible method of implementing https://github.com/iamkun/dayjs/issues/323, https://github.com/iamkun/dayjs/issues/249, https://github.com/iamkun/dayjs/issues/46

For localization, it's far easier to maintain because you do not need to create or maintain any translations on your side. This could fix several issues such as https://github.com/iamkun/dayjs/issues/416, https://github.com/iamkun/dayjs/issues/415, and https://github.com/iamkun/dayjs/issues/171. It's also easier for users because they don't need any extra files and everything works out-of-the-box. See [their Intl docs](https://moment.github.io/luxon/docs/manual/intl.html) and [code](https://github.com/moment/luxon/blob/master/src/impl/locale.js) for more details

Would there be any interest in this approach?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.