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

datetime format bestfit does not process a single configuration #190

Closed
caridy opened this issue Jun 17, 2016 · 9 comments · May be fixed by godaddy/external#6
Closed

datetime format bestfit does not process a single configuration #190

caridy opened this issue Jun 17, 2016 · 9 comments · May be fixed by godaddy/external#6

Comments

@caridy
Copy link
Collaborator

caridy commented Jun 17, 2016

Because CLDR skeletons always contain more than one configuration, or a fixed configuration for single entries, we end up missing the opportunity to provide the best result in BestFitFormatMatcher.

> new intl.DateTimeFormat('es', {"month": "long"}).format(new Date("08/14/2016"))
'ago.' <-- should be agosto

More examples about these are here from @mkohlmyr:

/cc @juandopazo @watilde

@caridy
Copy link
Collaborator Author

caridy commented Jun 17, 2016

The solution is to add some hard-wire in BestFitFormatMatcher to account for this cases.

@watilde
Copy link
Contributor

watilde commented Jun 20, 2016

Hmmm yeah it can be a hard code point like you said..

@juandopazo
Copy link
Contributor

Yeah. I took a look at the code. The calendar data is there, it's just that the possible configurations that the polyfill generates don't include single options.

@caridy
Copy link
Collaborator Author

caridy commented Jun 29, 2016

@juandopazo yes, we can included that as part of the data as well, that's the other part of the story.

@gabriel-miranda
Copy link

You can include the day and the month won't format either. Month can't use long for some reason. I'm trying to debug it.

@caridy
Copy link
Collaborator Author

caridy commented Jul 17, 2016

@gabriel-miranda yes, this is for any format that should use a single element in the formatter.

@caridy
Copy link
Collaborator Author

caridy commented Jul 21, 2016

solve by 20f322d

please, verify if this solves all your problems ;)

@gabriel-miranda
Copy link

@caridy Thanks for the tip I ended up parsing the relative date myself and using intl-relativeformat to support the languages. Maybe in the next months I will look up again for this. Ty anyway

@caridy
Copy link
Collaborator Author

caridy commented Sep 20, 2016

https://github.com/andyearnshaw/Intl.js/releases/tag/v1.2.5

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

Successfully merging a pull request may close this issue.

4 participants