2019-10-06 00:07:00 +09:00
|
|
|
use crate::config::{ModuleConfig, RootModuleConfig};
|
|
|
|
|
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
|
|
|
|
#[derive(Clone, ModuleConfig)]
|
|
|
|
pub struct TimeConfig<'a> {
|
2020-07-08 06:45:32 +08:00
|
|
|
pub format: &'a str,
|
|
|
|
pub style: &'a str,
|
2019-10-06 00:07:00 +09:00
|
|
|
pub use_12hr: bool,
|
2020-07-08 06:45:32 +08:00
|
|
|
pub time_format: Option<&'a str>,
|
2019-10-06 00:07:00 +09:00
|
|
|
pub disabled: bool,
|
2019-10-09 23:42:57 -05:00
|
|
|
pub utc_time_offset: &'a str,
|
2020-05-31 19:43:08 +02:00
|
|
|
pub time_range: &'a str,
|
2019-10-06 00:07:00 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> RootModuleConfig<'a> for TimeConfig<'a> {
|
|
|
|
fn new() -> Self {
|
|
|
|
TimeConfig {
|
2020-07-08 06:45:32 +08:00
|
|
|
format: "at [$time]($style) ",
|
|
|
|
style: "bold yellow",
|
2019-10-06 00:07:00 +09:00
|
|
|
use_12hr: false,
|
2020-07-08 06:45:32 +08:00
|
|
|
time_format: None,
|
2019-10-06 00:07:00 +09:00
|
|
|
disabled: true,
|
2019-10-09 23:42:57 -05:00
|
|
|
utc_time_offset: "local",
|
2020-05-31 19:43:08 +02:00
|
|
|
time_range: "-",
|
2019-10-06 00:07:00 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|