fix(time): Update calendar on timezone change

Closes: #698
This commit is contained in:
Josh Megnauth 2024-11-13 00:48:54 -05:00 committed by Michael Murphy
parent a9f9620d11
commit 7932be526d

View file

@ -431,6 +431,7 @@ impl cosmic::Application for Window {
Message::TimezoneUpdate(timezone) => {
if let Ok(timezone) = timezone.parse::<chrono_tz::Tz>() {
self.now = chrono::Local::now().with_timezone(&timezone).fixed_offset();
self.date_selected = chrono::NaiveDate::from(self.now.naive_local());
self.timezone = Some(timezone);
}