Date-fns: YYYY should be yyyy and DD should be dd

Created on 4 Jul 2017  路  3Comments  路  Source: date-fns/date-fns

The tokens accepted by date-fns are different with what most languages and libraries support.

I focus here on YYYY and DD.

Comparable:

  • AngularJS: yyyy dd instead of YYYY DD
  • Qt: yyyy dd instead of YYYY DD
  • C#: yyyy dd instead of YYYY DD
  • Java: yyyy dd instead of YYYY DD
  • Objective-C: yyyy dd instead of YYYY DD
  • Dart: yyyy dd instead of YYYY DD

They all follow the specifications from the Unicode Consortium CLDR: http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns

Not comparable:

Interpreted languages are mostly based on C function strftime() (so they are % based) since the interpreters are written in C. I guess strftime() predates the Unicode standard by several decades, that's why.

Edit: somewhat related to #351

馃審 I18n 馃槇 Breaking

Most helpful comment

Merged, going to be fixed with the next release

All 3 comments

Merged, going to be fixed with the next release

@leshakoss Is this a breaking change? Should all localization files also be updated for this?

@mesqueeb yes it is and yes they should. I've updated the contribution guide some time ago. Here is the list of locales to be updated: https://github.com/date-fns/date-fns/blob/master/outdatedLocales.json

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahtcx picture ahtcx  路  3Comments

Stradivario picture Stradivario  路  3Comments

ghost picture ghost  路  3Comments

mrclayman picture mrclayman  路  3Comments

duro picture duro  路  3Comments