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 introduces a custom
DateTime
that replaceschrono::DateTime<chrono_tz::Tz>
and solves a lot of use-cases for us. The problem withchrono::DateTime<chrono_tz::Tz>
is thatchrono_tz::Tz
does not contain a local timezone whereas bothDTSTART
andUNTIL
can be defined in local timezone. Previously we would have to storeDTSTART
as aDateTime<Utc>
even though it was specified in local timezone.Here is the new
DateTime
that is able to represent Local times as well:It emulates
chrono::DateTime
by just forwarding every API call to the underlyingchrono::DateTime
. It also implementsFrom<chrono::DateTIme>
so that users can still usechrono::DateTime
when setting the starte date, rdate, exdate etc. The big API difference is that iteration result returns this newDateTime
rather thanchrono::DateTime
, but theDateTime
can easily be converted to achrono::DateTime
by using the following methodDateTime::with_timezone(tz) -> chrono::DateTime
.Fixes #49
Fixes #74