Fix fr-CA culture time formatting and parsing #56443
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #54021
fr-CA
culture is using time format pattern likeHH 'h' mm 'min' ss 's'
which is causing 2 problems:h
as time separator. So, when formatting any DateTime object using this culture we produce wrong formatted time e.g.,10 h 5 h 50 h
. note thath
is used to separate the hour, minute, and second parts in the formatted string.DateTime.Parse
. This is because we cannot recognize the parts like `min' and 's' in the formatted time.The fix here is we are special casing this culture to explicitly setting the time separator to
:
which is other French cultures are using. Also, we added some support for this culture in the date/time parser to recognize such formats.