feature: chrono support #233
Open
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.
this pr will add
chronosupport to the crate and close issue #227So far, I've created type aliases to the respective date/time types in
chronoandtimeto make the implementation easier.I found something wrong with this approach through. It works fine to have the drop-in replacement feature flag for new projects or projects that don't already depend on cookie in some way, but existing ones would have to implement support for the
chronofeature flag to be able to take advantage of this.If this isn't fine, I could create a seperate module with something like a
ChronoCookie, which would just be a copy of Cookie usingchronoinstead. Then it would be possible to useCookie::into_chronoor vice versa to convert between. The drawback of this approach is maintaining the conversions betweentimeandchrono, and also requiring thetimedependency as achronouser, even if you never actually use itCurrently, however, it compiles with all features and all the parsing tests are passing for the
chronofeature. I will get the rest of the tests working in the next couple of days and update the test scriptA couple of updates outside of this feature would be to commit 3795f2e, where now abbreviated dates before 70 will be 21st century dates. This is because the browsers referenced in issue #162 have updated year normalization.
The other thing I updated was the tests for abbreviated dates, the day of the week was mismatched with the actual day, causing the
chronotest to fail (it passes now). I'm unsure if it's the custom parsing function for shorttimedates that ignores this, ortimeitself, but that seems like it could be an issue