adopted-ember-addons / ember-moment

MIT License
400 stars 122 forks source link

Set `MomentOverride.defaultFormat` to ISO 8601 format if not defined in config #364

Closed davideferre closed 2 years ago

davideferre commented 2 years ago

Fixes #362

Improves PR #363 with fall back to moment.js default format (ISO 8601) if no value is set in configuration

jfdnc commented 2 years ago

https://github.com/adopted-ember-addons/ember-moment/pull/363 returns this lib's functionality to previous state. Passing defaultFormat explicitly as null allows momentjs to fall back to ISO8601, we do not need to specify that string format directly. To be fair, that default will prob never change because momentjs is EOL, but I think we should still pass null here and let it handle defaulting on its own.

alexlafroscia commented 2 years ago

I think it makes more sense to avoid changing the original behavior rather than defining new fallback behavior, so I merged #363. I really appreciate your contribution here though, @davideferre! Thank you for offering a fix for this pressing issue.