Skip to content
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

fixes #758 -- correctly document that %Y parses negative years #760

Merged
merged 1 commit into from Aug 9, 2022

Conversation

alex
Copy link
Contributor

@alex alex commented Aug 6, 2022

No description provided.

@djc
Copy link
Contributor

djc commented Aug 6, 2022

Thanks. I wonder if we should more thoroughly document the edge cases here -- like how many characters this needs for NaiveDate::MIN.

@alex
Copy link
Contributor Author

alex commented Aug 6, 2022

I think you dropped a word there :-) What should we do more thoroughly?

@djc
Copy link
Contributor

djc commented Aug 6, 2022

Oops! "document"

@alex
Copy link
Contributor Author

alex commented Aug 6, 2022

That's probably a good idea. Here I'm just trying to do the minimum to address the issue I ran into :-)

Copy link
Contributor

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @esheppa what do you think?

I think it's better hear to keep the range for %Y consistent with the range we allow internally (as much as possible), such that we should allow negative years here -- and change the documentation -- vs following the documentation and clamping the year to some number (0000 or 0001, I suppose) to avoid negative years.

The documentation originates in 43ee68b. The implementation started allowing negative years in 0399ba1.

Copy link
Collaborator

@esheppa esheppa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, and there are some tests for this in src/format/parse.rs so no need to add any more for this PR.

@esheppa esheppa merged commit 5edf4d0 into chronotope:main Aug 9, 2022
@alex alex deleted the patch-1 branch August 9, 2022 12:24
mtremer pushed a commit to ipfire/ipfire-2.x that referenced this pull request Nov 11, 2022
- Updated from version 0.4.19 to 0.4.22
- Update of rootfile
- Update of metadata patch as more windows related entries in Cargo.toml to be excluded
- Changelog
	## 0.4.22
		* Allow wasmbindgen to be optional on `wasm32-unknown-unknown` target [(#771)](chronotope/chrono#771)
		* Fix compile error for `x86_64-fortanix-unknown-sgx` [(#767)](chronotope/chrono#767)
		* Update `iana-time-zone` version to 1.44 [(#773)](chronotope/chrono#773)
	## 0.4.21
		* Fall back to UTC timezone in cases where no timezone is found [(#756)](chronotope/chrono#756)
		* Correctly detect timezone on Android [(#756)](chronotope/chrono#756)
		* Improve documentation for strftime `%Y` specifier [(#760)](chronotope/chrono#760)
	## 0.4.20
		* Add more formatting documentation and examples.
		* Add support for microseconds timestamps serde serialization/deserialization (#304)
		* Fix `DurationRound` is not TZ aware (#495)
		* Implement `DurationRound` for `NaiveDateTime`
		* Implement `std::iter::Sum` for `Duration`
		* Add `DateTime::from_local()` to construct from given local date and time (#572)
		* Add a function that calculates the number of years elapsed between now and a given `Date` or `DateTime` (#557)
		* Correct build for wasm32-unknown-emscripten target (#568)
		* Change `Local::now()` and `Utc::now()` documentation from "current date" to "current date and time" (#647)
		* Fix `duration_round` panic on rounding by `Duration::zero()` (#658)
		* Add optional rkyv support.
		* Add support for microseconds timestamps serde serialization for `NaiveDateTime`.
		* Add support for optional timestamps serde serialization for `NaiveDateTime`.
		* Fix build for wasm32-unknown-emscripten (@yu-re-ka #593)
		* Make `ParseErrorKind` public and available through `ParseError::kind()` (#588)
		* Implement `DoubleEndedIterator` for `NaiveDateDaysIterator` and `NaiveDateWeeksIterator`
		* Fix panicking when parsing a `DateTime` (@botahamec)
		* Add support for getting week bounds based on a specific `NaiveDate` and a `Weekday` (#666)
		* Remove libc dependency from Cargo.toml.
		* Add the `and_local_timezone` method to `NaiveDateTime`
		* Fix the behavior of `Duration::abs()` for negative durations with non-zero nanos
		* Add compatibility with rfc2822 comments (#733)
		* Make `js-sys` and `wasm-bindgen` enabled by default when target is `wasm32-unknown-unknown` for ease of API discovery
		* Add the `Months` struct and associated `Add` and `Sub` impls

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants