-
Notifications
You must be signed in to change notification settings - Fork 215
supporting short month
format in most cases to match browser's behavior
#85
Conversation
another alternative is to continue the work on #77 |
@caridy what's the gz size difference between the current and this new data for say |
* supporting short month format in most cases to match browser's behavior * cldr 26 from JSON data source * tested in nodejs 12 * removed any java specific step in the build
Hmm.. #69 (and #88) seems not to be fixed by this change, am I missing something? $ npm install
$ $(npm bin)/grunt update-cldr-data
$ $(npm bin)/grunt cldr
$ $(npm bin)/grunt
$ node -v
> require("./index")
{ __localeSensitiveProtos:
{ Number: { toLocaleString: [Function] },
Date:
{ toLocaleString: [Function],
toLocaleDateString: [Function],
toLocaleTimeString: [Function] } },
default: [Circular] }
> new Intl.DateTimeFormat("ja",{year:"numeric",month:"long",day:"numeric",weekday:"long"}).format(new Date())
'2015年3月月28日(土曜日)' Expected result as follows (Chrome's result). > new Intl.DateTimeFormat("ja",{year:"numeric",month:"long",day:"numeric",weekday:"long"}).format(new Date())
"2015年3月28日土曜日" |
@okuryu this is really not much about the short variation (yes, I have a patch in there to add few shorts variations, but this is really about the new build process so we can start making significant changes again. To be more specific, we want to use CLDR data to support all variations, by simply using CLDR data directly instead of a computed portion of it. Here you can see the big difference from one locale to another: https://github.com/unicode-cldr/cldr-dates-full/blob/master/main/en-001/ca-gregorian.json#L309-L349 As you can see, they don't have the same entries, instead, we just need to update our computations, to pick up the right variation from the list available instead of a predefined, prebuild subset. This PR seems to be complete now, although functional tests (saucelab tests are failing, I might need help with that since I don't have too much time before going on vacation). |
I'm +1 for whatever we need to do to make Intl.js act like browsers do. |
…d in the spec, this will help to match browsers
fixes #77 |
fixes #75 |
fixes #69 |
fixes #68 |
@juandopazo is working on the saucelab failures which is the only missing bit at this point for rc1 to be released. |
We were able to test saucelabs manually, we just need to figure what to do with the travis integration that is failing today. I will merge this and figure that in a different PR. |
ping @caridy it'd be awesome if u can merge this 👍 thanks! |
supporting short `month` format in most cases to match browser's behavior
Thanks @andyearnshaw. When can we expect it to be published? |
@caridy it seems that there's missing src file
|
Can you please release a new version/tag with this fix? Thank you. |
publish it please 👍 |
yep a new npm version with these fixes would be great |
1.0.0-rc-1 is in NPM, help us to test it... |
works fine for me, thks a lot |
Issue ember-intl/ember-intl#101 is partially fixed (works fine on Chrome and IE11, not on IE9 and IE10). Regards, |
@bcecchinato thanks for the report. Can you give us more details about the issue wiht IE9/IE10? |
@caridy : When using the following format for date : export default {
'date-style': {
day: '2-digit',
month: '2-digit',
year: 'numeric'
}
}; Day and month are on one digit when lower than 10. For instance, 15/06/2015 would be written 15/6/2015. The issue was also occurring on Chrome and IE11, since the 1.0.0-rc-1 it seems to be fixed. Regards, |
can you open an issue for that so we can try to fix it. I have some suspicious about it, but I will have to dig in. |
This matches FF and Chrome implementations. As a result, we get support these new entries:
This does not come for free though, it increases the size of the data slightly, but not significant IMO, essentially it will increase each locale with:
I will probably propose to drop the two first entries, at the end of the day, if you are going for the expanded date format, you probably don't care about short month since you're using long weekday, and even time, e.g.:
That will be sort of a middle ground where we will increase just few entries to support the minimum number of formats.