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

1.x equivalent to Globalize.culture().calendar[":"] from 0.x #668

Closed
Retsam opened this issue Jan 6, 2017 · 2 comments
Closed

1.x equivalent to Globalize.culture().calendar[":"] from 0.x #668

Retsam opened this issue Jan 6, 2017 · 2 comments

Comments

@Retsam
Copy link
Contributor

Retsam commented Jan 6, 2017

I'm trying to migrate some code from globalize 0.x to 1.x, and I've run across code that relies on Globalize.culture().calendar[":"] to determine the delimiter between parts of a time. So far I haven't been able to find any such equivalent in the CLDR data.

Is there an equivalent that I've missed? Or a way to reliably calculate an equivalent?

@rxaviers
Copy link
Member

Those time parts (as any other literals) are simply part of the pattern, for example: https://github.com/unicode-cldr/cldr-dates-modern/blob/master/main/es-US/ca-gregorian.json#L341

Why does the application need access to that info? To add styles / markups to it? If so, the correct solution is in this line: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts. I'm open to support formatToParts in globalize. PR welcome 💛

@rxaviers
Copy link
Member

Closing in favor of #678

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