borgar / numfmt

Full ECMA-376 number and date formatting in JavaScript
40 stars 9 forks source link

Reconsider parseValue results for "Feb 20" style dates #31

Closed borgar closed 1 year ago

borgar commented 1 year ago

Currently, the output for parseValue("Feb 20") is parsed as { v: 44612, z: 'mmm-d' } (20 feb 2022). This is consistent with what Google Sheets does but not what users seem to expect.

One can reason it this way:

However, Feb 02 seems obviously to be a month-year. So then why isn't Feb 20?

Ultimately there are no right or perfect answers here, but my feeling is that is more likely that trailing digits are years in this context than days (and the inverse: leading digits more likely to be days).

So we should move to: