1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-15 17:47:13 +00:00
starship/src/configs/time.rs
Keith Wade 9d48706360 feat: Implement timezone offset config option for the time module (#463)
This allows users to configure the time module to display time with a timezone offset other than just their local timezone.
2019-10-10 13:42:57 +09:00

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",
}
}
}