Set warning colors for British time too.

This commit is contained in:
Bill Thiede 2019-09-23 13:18:14 -07:00
parent f704d9cdf1
commit c4920a1e6e

View File

@ -30,18 +30,30 @@ fn main() {
// Realtime upload/download rate for a interface
bar.push(NetworkSpeedWidget::new(&opts.nic, 6));
bar.push(DateTimeWidget::tz(
let mut dt = DateTimeWidget::tz(
"%H:%M %Z".to_string(),
"Europe/London".to_string(),
));
let mut dt = DateTimeWidget::new("%m/%d %H:%M".to_string());
);
dt.set_colors(&vec![
TimeColor {
start: NaiveTime::from_hms(13, 0, 0),
color: ColorRGB::yellow(),
},
TimeColor {
start: NaiveTime::from_hms(14, 0, 0),
start: NaiveTime::from_hms(16, 0, 0),
color: ColorRGB::red(),
},
]);
bar.push(dt);
let mut dt = DateTimeWidget::new("%m/%d %H:%M".to_string());
dt.set_colors(&vec![
TimeColor {
start: NaiveTime::from_hms(15, 0, 0),
color: ColorRGB::yellow(),
},
TimeColor {
start: NaiveTime::from_hms(16, 0, 0),
color: ColorRGB::red(),
},
]);