mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-11-15 17:47:13 +00:00
9d48706360
This allows users to configure the time module to display time with a timezone offset other than just their local timezone.
26 lines
609 B
Rust
26 lines
609 B
Rust
use crate::config::{ModuleConfig, RootModuleConfig};
|
|
|
|
use ansi_term::{Color, Style};
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
#[derive(Clone, ModuleConfig)]
|
|
pub struct TimeConfig<'a> {
|
|
pub use_12hr: bool,
|
|
pub format: Option<&'a str>,
|
|
pub style: Style,
|
|
pub disabled: bool,
|
|
pub utc_time_offset: &'a str,
|
|
}
|
|
|
|
impl<'a> RootModuleConfig<'a> for TimeConfig<'a> {
|
|
fn new() -> Self {
|
|
TimeConfig {
|
|
use_12hr: false,
|
|
format: None,
|
|
style: Color::Yellow.bold(),
|
|
disabled: true,
|
|
utc_time_offset: "local",
|
|
}
|
|
}
|
|
}
|