[gen_l10n] to handle arbitrary DateFormat patterns #86844
Conversation
|
The reason we used the DateFormat factory constructors, instead of just allowing the developer to specifying an arbitrary format string, was because it eliminated the possibility of a runtime error due to a bad format string. I agree that it's reasonable to allow developers to specify an arbitrary format string - as an alternative - however I don't think we should stop recognizing the ones that correspond to DateFormat factory constructors. I assume that most apps, most of the time, will be able to use the formats for which there is a factory constructor. We want to avoid breaking anything and to encourage developers to continue to use the standard formats when possible. For example you could introduce a placeholder attribute like isCustomFormat, ( Sorry about all of the direction; hope this makes sense. |
|
Thanks a lot for your feedback and detailed guidance. This would be better, to try help developers to use standard format whenever possible. |
|
@asashour what is the current state of this PR? |
|
LGTM |
Fixes #77646
Use
DateFormatconstructor with any arbitrary pattern. However, I am not sure if it should throw an exception in some particular case.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.