Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E_UNSUPPORTED: Unsupported {"feature": "year pattern u"} #10

Closed
sibelius opened this issue Sep 6, 2016 · 4 comments
Closed

E_UNSUPPORTED: Unsupported {"feature": "year pattern u"} #10

sibelius opened this issue Sep 6, 2016 · 4 comments

Comments

@sibelius
Copy link

sibelius commented Sep 6, 2016

I'm receiving the following error when I try to format a date

<FormattedDate
            value={new Date()}
            skeleton="dMy"
            />

skeleton="yMd" works fine

@joshswan
Copy link
Owner

joshswan commented Sep 6, 2016

Skeletons need to be specified in largest to smallest order so skeleton="yMd" would be the correct skeleton in this case. The date formatting is then carried out based on norms for that particular language/locale, NOT based on the order of your skeleton.

You can see examples of some formatting options in the documentation for the Globalize library: https://github.com/jquery/globalize/blob/master/doc/api/date/date-formatter.md

@sibelius
Copy link
Author

sibelius commented Sep 6, 2016

thanks for the explanation

yMD -> 11/30/2010

what if I want to display year using only 2 digits instead of 4?

is that possible?

@joshswan
Copy link
Owner

joshswan commented Sep 6, 2016

Based on the CLDR documentation, skeleton="yyMd" should work. However, not all skeletons work as expected: globalizejs/globalize#271

If not, this will work: <FormattedDate value={new Date()} date="short" />. The "date", "time", and "datetime" parameters on the date formatter page all work just fine.

@sibelius
Copy link
Author

sibelius commented Sep 6, 2016

thanks I'll try that

@sibelius sibelius closed this as completed Sep 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants