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:
co-authored by
Max Brunsfeld
parent
3d4ff43f9e
commit
f59e02cf25
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user