date-fns / date-fns-upgrade

A tool for upgrading date-fns versions
8 stars 8 forks source link

fix: handle single `a` token #11

Closed kamranayub closed 1 year ago

kamranayub commented 3 years ago

Discovered a bug while running migration verification tests from v1 to v2 with our codebase. convertTokens is not handling the a token correctly. In v1, a => am but in v2 a => AM and this needs to be handled.

Related https://github.com/date-fns/date-fns/issues/946

Changes

kamranayub commented 3 years ago

Looks likes this will be aaa when this is approved: https://github.com/date-fns/date-fns/pull/2016

kamranayub commented 3 years ago

I'd say this workaround is "good enough" stopgap until aaa becomes supported in a future version (in which case, this may need to be smart about peerDependencies and when to use what approach).