Use macOS API to retrieve the local timezone

The `time` crate currently doesn't have a reliable way to get that.
In the future, `NSSystemTimeZoneDidChangeNotification` could be
used to keep the cached timezone up-to-date.

Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
Antonio Scandurra
2021-09-02 19:15:05 +02:00
co-authored by Max Brunsfeld
parent 3d4ff43f9e
commit f59e02cf25
7 changed files with 30 additions and 6 deletions
+3
View File
@@ -26,6 +26,7 @@ use std::{
rc::Rc,
sync::Arc,
};
use time::UtcOffset;
pub trait Platform: Send + Sync {
fn dispatcher(&self) -> Arc<dyn Dispatcher>;
@@ -49,6 +50,8 @@ pub trait Platform: Send + Sync {
fn read_credentials(&self, url: &str) -> Option<(String, Vec<u8>)>;
fn set_cursor_style(&self, style: CursorStyle);
fn local_timezone(&self) -> UtcOffset;
}
pub(crate) trait ForegroundPlatform {