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

Correctly order earliest / latest for Ambiguous times in local TimeZone #1626

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/offset/local/tz_info/rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
} else if local_time >= dst_end_transition_end
&& local_time <= dst_end_transition_start
{
Ok(crate::MappedLocalTime::Ambiguous(self.std, self.dst))
Ok(crate::MappedLocalTime::Ambiguous(self.dst, self.std))
} else {
Ok(crate::MappedLocalTime::Single(self.std))
}
Expand All @@ -284,7 +284,7 @@
} else if local_time >= dst_end_transition_end
&& local_time <= dst_end_transition_start
{
Ok(crate::MappedLocalTime::Ambiguous(self.std, self.dst))
Ok(crate::MappedLocalTime::Ambiguous(self.dst, self.std))
} else if local_time > dst_end_transition_end
&& local_time < dst_start_transition_start
{
Expand All @@ -309,7 +309,7 @@
} else if local_time >= dst_start_transition_end
&& local_time <= dst_start_transition_start
{
Ok(crate::MappedLocalTime::Ambiguous(self.dst, self.std))
Ok(crate::MappedLocalTime::Ambiguous(self.std, self.dst))

Check warning on line 312 in src/offset/local/tz_info/rule.rs

View check run for this annotation

Codecov / codecov/patch

src/offset/local/tz_info/rule.rs#L312

Added line #L312 was not covered by tests
} else if local_time > dst_start_transition_start
&& local_time < dst_end_transition_start
{
Expand Down Expand Up @@ -337,7 +337,7 @@
} else if local_time >= dst_start_transition_end
&& local_time <= dst_start_transition_start
{
Ok(crate::MappedLocalTime::Ambiguous(self.dst, self.std))
Ok(crate::MappedLocalTime::Ambiguous(self.std, self.dst))
} else {
Ok(crate::MappedLocalTime::Single(self.dst))
}
Expand Down
Loading
Loading