-
Notifications
You must be signed in to change notification settings - Fork 215
Intl.DateTimeFormat with just one option #75
Comments
I also noticed this with with the following example: var df = new Intl.DateTimeFormat('en', {year: 'numeric'});
console.log(df.format(Date.now())); In Chrome or Firefox it outputs: According to the docs on MDN for Intl.DateTimeFormat:
|
Is the |
for what I can tell, the locale-data was reduced intentionally to support +90% of the cases in favor of not blowing up the size of the locale-data, which ultimately means that not all combinations are supported, but @andyearnshaw can provide more details. |
Not respecting 2-digit hours doesn't seem like an issue of reduction... and while I imagine we're talking about I'll just have to split it in two for now and treat date and time formatting as part of the message. |
I just ran into this issue as well and thought I was going crazy. // Chrome
new Intl.DateTimeFormat('en', { month: 'short' }).format(new Date) // "Feb"
// Polyfill
new Intl.DateTimeFormat('en', { month: 'short' }).format(new Date) // "February 2015" @andyearnshaw Can you shed any light here? |
related to #68, we will try to fix it asap. |
@caridy Thank you! ❤️ |
fixed by #85 |
@caridy thanks too for this fix! Fantastic work :) |
1.0.0-rc-1 is in NPM, help us to test it... |
Following issue on Safari will return the short version of the month instead of long, using latest intl@1.0.0. Anyone else having this issue?
|
Intl.DateTimeFormat
seems to work fine if you use all its options. For example, the behavior of the polyfill for this looks correct:However, when you specify only one option, the polyfill seems to include other parts of the date:
/cc @caridy @ericf
The text was updated successfully, but these errors were encountered: