Fix parsing of localized meridians (refers #228) #244
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.
changes
a
token now accepts onlyam/pm
forms as stated previouslyin documentation
A
token accepts botham/pm
andAM/PM
forms to ensure backwardscompatibility
A
&a
tokensAdditional notes:
token
A
: existing tests ensured thatA
token accepts both lowercase and uppercase meridians. I decided to keep this behaviour to ensure backwards compatibility. I think this could be changed in future to accept only uppercase but this would require bumping of major version part.token
a
: I have decided to drop support fora/A/p/P
values from following reason:a => am/pm
,A => AM/PM
a
already translates toam/pm
instead ofa/p/A/P
and such inconsistency should be treated as a major issue. So this needed to be made consistent across format/parse and I think the best option is to follow already documented behaviour.documentation: we have few tokens that supports localization. I have added two footnotes to tokens table because this was not obvious if dates with those tokens can be parsed using locale. Additionally the footnote on
ddd
anddddd
says that these tokens support only formatting since we do not allow such tokens in parse calls.