-
Notifications
You must be signed in to change notification settings - Fork 603
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 format to parts #678
Comments
Some API ideas
|
For the record, @jzaefferer and I have discussed these options and we leaned towards option 2. It seems the one the fits the best for globalize in a way that keeps API simple. Suggestions and ideas are welcome... |
I am by no means an expert here but reviewing the information you have provided, I would also lean toward option option 2 if that helps at all. |
Thank you @kborchers, it definitely helps. |
Fixes globalizejs#678 Closes globalizejs#697 Closes globalizejs#700
When dateToPartsFormatter was added, dateFormatter became an alias to it. Although globalize-compiler can handle it by using `.compileExtracts()`, it doesn't by using `.compile()` and passing `formattersAndParsers` argument. This update fixed that. Amends e4234a7 Ref globalizejs#678 Ref globalizejs#697 Ref globalizejs#700
Context
Formatter is designed to provide an opaque string as an output that is not meant to be manipulated by the consumer, which makes impossible for UX/design using rich formatting, e.g.,
"May <strong>05</strong> 2014"
,"09:49 <i>pm</i>"
, and"<strong>Monday</strong>, 09/12/2015"
.Goal
Expose format to parts similarly to Ecma-402 Intl.DateTimeFormat.prototype.formatToParts().
References
The text was updated successfully, but these errors were encountered: