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

Date (skeletons): dynamically augment availableFormats #271

Closed
rxaviers opened this issue Jun 3, 2014 · 3 comments · Fixed by #703
Closed

Date (skeletons): dynamically augment availableFormats #271

rxaviers opened this issue Jun 3, 2014 · 3 comments · Fixed by #703

Comments

@rxaviers
Copy link
Member

rxaviers commented Jun 3, 2014

WIP PR: #703 (replaced #604 and #462)


As specification says:

It is not necessary to supply dateFormatItems with skeletons for every field length; in many cases fields in the skeleton and pattern can be expanded in parallel to handle a request. Consider the following dateFormatItem:

<dateFormatItem id="yMMMd">d MMM y</dateFormatItem>

If the request is for yMMMMd, the above item can be automatically expanded to produce the pattern "d MMMM y" in response to the request. Of course, if the desired behavior is that a request for yMMMMd should produce something other than "d MMMM y", a separate dateFormatItem must be added, for example:

<dateFormatItem id="yMMMMd">d 'de' MMMM 'de' y</dateFormatItem>

http://www.unicode.org/reports/tr35/tr35-dates.html#availableFormats_appendItems

We need to support that on .formatDate().

@rxaviers rxaviers added this to the 1.0.0 milestone Sep 30, 2014
@rxaviers rxaviers modified the milestones: 1.0.1, 1.0.0 Oct 29, 2014
vectart added a commit to vectart/globalize that referenced this issue Jul 15, 2015
vectart added a commit to vectart/globalize that referenced this issue Jul 15, 2015
vectart added a commit to vectart/globalize that referenced this issue Jul 15, 2015
Dynamically augment availableFormats

Fixes globalizejs#271
@rxaviers rxaviers modified the milestone: 1.1.0 Oct 11, 2015
Strate added a commit to megaplan/globalize that referenced this issue Mar 22, 2016
Strate added a commit to megaplan/globalize that referenced this issue Mar 22, 2016
Strate pushed a commit to Strate/globalize that referenced this issue Apr 2, 2016
Dynamically augment availableFormats

Fixes globalizejs#271
Strate added a commit to Strate/globalize that referenced this issue Apr 3, 2016
Rework of `getBestMatchPattern` algorithm
 - properly handle close parts of sekletons, i.e. `L` and `M`
 - better distance calculating
Call to `getBestMatchPattern` before splitting skeleton to date and time parts
Add a lot of test cases to `expandPattern` function.

Fixes globalizejs#271
@AndreR
Copy link

AndreR commented Oct 20, 2016

Any news on this topic? I wanted to use the skeleton "MMMM" with Globalize set to German, but I ended up with that exact same error message E_UNSUPPORTED: Unsupported {"feature": "year pattern u"}. If I set it to English, it works, though.

Any chance that this will be fixed anytime soon?

@rxaviers
Copy link
Member Author

Hi @AndreR, #604 is stalled. Would you like to take it over? I'd be happy if you could address the comments in that PR. You could create a new pull request on top of that one with additional commits. Just let me know if you have any questions. Thanks

@AndreR
Copy link

AndreR commented Oct 21, 2016

Hi @rxaviers, I would love to help you out here, but my Javascript skills are too basic. I'm sorry!

rxaviers pushed a commit to rxaviers/globalize that referenced this issue Mar 13, 2017
Dynamically augment availableFormats

Fixes globalizejs#271
rxaviers pushed a commit to rxaviers/globalize that referenced this issue Mar 13, 2017
Rework of `getBestMatchPattern` algorithm
 - properly handle close parts of sekletons, i.e. `L` and `M`
 - better distance calculating
Call to `getBestMatchPattern` before splitting skeleton to date and time parts
Add a lot of test cases to `expandPattern` function.

Fixes globalizejs#271
rxaviers pushed a commit to rxaviers/globalize that referenced this issue Mar 14, 2017
rxaviers pushed a commit to rxaviers/globalize that referenced this issue Mar 14, 2017
Rework of `getBestMatchPattern` algorithm
 - properly handle close parts of sekletons, i.e. `L` and `M`
 - better distance calculating
Call to `getBestMatchPattern` before splitting skeleton to date and time parts
Add a lot of test cases to `expandPattern` function.

Fixes globalizejs#271
rxaviers added a commit to rxaviers/globalize that referenced this issue Mar 14, 2017
rxaviers added a commit to rxaviers/globalize that referenced this issue Mar 14, 2017
rxaviers added a commit to rxaviers/globalize that referenced this issue Mar 14, 2017
rxaviers added a commit to rxaviers/globalize that referenced this issue Mar 17, 2017
@rxaviers rxaviers added this to the 1.3.0 milestone Mar 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment