linux: Implement local time zone support (#14610)
I decided to remove the GPUI APIs since `chrono` already provides this functionality, and is already been used for this purpose in other parts of the code (e.g. [here](80402a6840/crates/zed/src/main.rs (L756)
) or [here](80402a6840/crates/ui/src/utils/format_distance.rs (L258)
)) These usages end up calling the `time_format` crate, which takes in a `UtcOffset`. It's probably cleaner to rewrite the crate to take in `chrono` types, but that would require rewriting most of the code there. Release Notes: - linux: Use local time zone in chat and Git blame
This commit is contained in:
parent
22a2cc6950
commit
013c9f0420
14 changed files with 26 additions and 72 deletions
|
@ -49,7 +49,6 @@ use std::{
|
|||
slice, str,
|
||||
sync::Arc,
|
||||
};
|
||||
use time::UtcOffset;
|
||||
|
||||
use super::renderer;
|
||||
|
||||
|
@ -760,14 +759,6 @@ impl Platform for MacPlatform {
|
|||
}
|
||||
}
|
||||
|
||||
fn local_timezone(&self) -> UtcOffset {
|
||||
unsafe {
|
||||
let local_timezone: id = msg_send![class!(NSTimeZone), localTimeZone];
|
||||
let seconds_from_gmt: NSInteger = msg_send![local_timezone, secondsFromGMT];
|
||||
UtcOffset::from_whole_seconds(seconds_from_gmt.try_into().unwrap()).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
fn path_for_auxiliary_executable(&self, name: &str) -> Result<PathBuf> {
|
||||
unsafe {
|
||||
let bundle: id = NSBundle::mainBundle();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue