2019-10-05 15:07:00 +00:00
|
|
|
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,
|
2019-10-10 04:42:57 +00:00
|
|
|
pub utc_time_offset: &'a str,
|
2019-10-05 15:07:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> RootModuleConfig<'a> for TimeConfig<'a> {
|
|
|
|
fn new() -> Self {
|
|
|
|
TimeConfig {
|
|
|
|
use_12hr: false,
|
|
|
|
format: None,
|
|
|
|
style: Color::Yellow.bold(),
|
|
|
|
disabled: true,
|
2019-10-10 04:42:57 +00:00
|
|
|
utc_time_offset: "local",
|
2019-10-05 15:07:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|