Paul Dicker

Results 308 comments of Paul Dicker
trafficstars

> Ignore the above question, it's probably because year 0 doesn't exist, right? So passing 0 means year -1 BCE? The reason to change `NaiveDate::MIN` was because a `DateTime` can...

As another thought: if your code was allowing values close to `DateTime::MIN` or `DateTime::MAX`, it was probably easy to craft inputs that would make it panic. Sorry for breaking thing...

Chrono uses the [Proleptic Gregorian calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar). The year 1 BCE is the year 0 in the Proleptic Gregorian calendar. And individual dates before the switch from the Julian to Gregorian...

> I'm asking because if passing `-1` as year means `year 1 BCE`, then either the comment or implementation is wrong (because the comment says that minimum date is `January...

Found more oddity to document for the `to_naive_datetime_with_offset` method: > The offset is assumed to have a given value. It is not compared against the offset field set in the...

> * If there is a timestamp and an offset field, the offset is added to the timestamp. But the definition of a Unix timestamp is that the value is...

Found one more missing error case in `Parsed::to_fixed_offset`. The use of `Option`s covered it up :smile:. If there is no offset field set, it should return `NOT_ENOUGH` instead of `OUT_OF_RANGE`.

> Found one more missing error case in `Parsed::to_fixed_offset`. Wow, apparently I found and fixed it last year also in #1042 😆.

Simplified `from_isoywd` a bit and made that into a commit that can apply to the main branch.

I'll keep this PR open a little longer until we have a new merge of main with the 0.5.x branch.