Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Support nominative case of month names #126

Open
vectart opened this issue Jul 15, 2015 · 6 comments
Open

Support nominative case of month names #126

vectart opened this issue Jul 15, 2015 · 6 comments
Assignees

Comments

@vectart
Copy link

vectart commented Jul 15, 2015

Many languages on the Earth have cases and particularly nominative and genitive ones. That's why CLDR locale data contains stand-alone month translations but Intl.js one doesn't. In result, we have wrong formatted strings.

Locale MMMM { month: 'long' } MMMMd { month: 'long', day: 'numeric' }
FI native huhtikuu 5. huhtikuuta
FI polyfill huhtikuuta 💥 5. huhtikuuta
RU native апрель 5 апреля
RU polyfill апреля 💥 5 апреля
@vectart
Copy link
Author

vectart commented Jul 15, 2015

Related to #124 and #117

@vectart vectart changed the title Support genitive case of month names Support nominative case of month names Jul 15, 2015
@andyearnshaw
Copy link
Owner

If we do it for month names then we probably ought to do it for weekdays too. It's probably best to only include this data where it differs from the standard format so as not to unnecessarily increase the JSON file sizes for most languages.

@caridy
Copy link
Collaborator

caridy commented Feb 11, 2016

I will be happy to take this, but we need to run some tests to see how much data are we talking about here. As for the 402 spec, I think we are covered by https://tc39.github.io/ecma402/#sec-formatdatetime 12.1.6.13.a.ix, specifically, this sentence:

ix. Else if f is "narrow", "short", or "long", then ... If p is "month", then the String value may also depend on whether dateTimeFormat has a [[day]] internal slot. If p is "timeZoneName", then the String value may also depend on the value of the [[inDST]] field of tm, ...

It doesn't say anything about quarters or weekdays. Do you think we should include that in the specification? /cc @srl295 @JCEmmons

@nodkz
Copy link

nodkz commented Mar 4, 2016

I am using react-intl@2.0.0-beta for client and server. Right now server-rendering (with Intl polyfill) differs from browser (build-in Intl).

screen shot 2016-03-04 at 17 41 15

@ericf I use something like this

<FormattedDate
    value={new Date(exper.start)}
    month="long"
    year="numeric"
/>

So I think for isomorphic JS applications it is very important to have correct cases for months and weeks. Regardless to file sizes.

May be you can build second npm module with all cases? And give it name, something like intl-huge.

@caridy
Copy link
Collaborator

caridy commented Feb 14, 2018

@nodkz checksum will always be a problem when rehydrating. in the past I remember some conversations with some react folks to allow holes in the checksum verification process for cases like this where the rehydration might attempt to change the value. I also remember something about the formatjs components opting out of the update for the first rehydration.

@urfijus
Copy link

urfijus commented Feb 26, 2018

Guys, any plans when it will be fixed?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants