makepanic / ember-power-calendar-date-fns

Internal utils of Ember Power Calendar built on top of date-fns
MIT License
2 stars 8 forks source link

feat: Enhance localization, update date-fns dependency to ^2.2.1 #7

Closed veelci closed 4 years ago

veelci commented 4 years ago

Update date-fns dependency to ^2.2.1, implement localeStartOfWeek(), getWeekdaysShort(), getWeekdaysMin(), and getWeekDays()

makepanic commented 4 years ago

Thanks. I think we must now make it configurable to load a different locale as import locales from 'date-fns/locale' will probably include all locales, even if the developers doesn't need them.

veelci commented 4 years ago

Yes. import locales from 'date-fns/locale' will import all locales from date-fns. I attempted to dynamically import them via ember-auto-import's dynamic import, but import() requires a string literal.

I've seen other libraries such as ember-moment require which locales are needed to be specified in environment.js. That may be the route to go here.