aboutsummaryrefslogtreecommitdiffstats
path: root/src/widgets/command.rs
diff options
context:
space:
mode:
authorDaniel Jankowski <Daniel.Jankowski@rub.de>2024-04-16 10:59:15 +0200
committerGitHub <noreply@github.com>2024-04-16 10:59:15 +0200
commit072392300409c11930cb07f56fab03eda2c24d4a (patch)
treea009352ec85fa705d239166873d14ef469b3fbea /src/widgets/command.rs
parentfix: toggle pane frames with floating panes (diff)
downloadsl0pstatus-072392300409c11930cb07f56fab03eda2c24d4a.tar.gz
sl0pstatus-072392300409c11930cb07f56fab03eda2c24d4a.tar.xz
sl0pstatus-072392300409c11930cb07f56fab03eda2c24d4a.zip
feat: remote control zjstatus with pipes (#48)
* chore: update to latest version of zellij * fix: deprecated functions in chrono * chore: update nix deps * chore: remove deprecated chrono functions * feat: add refresh via pipes with line protocol * fix: handle multiple lines in pipe * fix(clippy): char instead of str * feat: add notification widget * chore: update nix flake * chore: update cargo deps * chore: update cargo deps * chore: update nix flake * chore: clean up imports for tracing * chore: update nix flake * chore: update cargo deps * chore: update nix flake * chore: update cargo deps * chore: remove pinning of chrono Since chrono-tz now fixed the deprecations from chrono we can finally remove the pinning. * chore: update nix flake * chore: update cargo deps
Diffstat (limited to 'src/widgets/command.rs')
-rw-r--r--src/widgets/command.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/command.rs b/src/widgets/command.rs
index 05bc94a..9e095c9 100644
--- a/src/widgets/command.rs
+++ b/src/widgets/command.rs
@@ -210,13 +210,13 @@ fn get_timestamp_from_event_or_default(
return Local::now();
}
- return Sub::<Duration>::sub(Local::now(), Duration::days(1));
+ return Sub::<Duration>::sub(Local::now(), Duration::try_days(1).unwrap());
}
let command_result = command_result.unwrap();
let ts_context = command_result.context.get("timestamp");
if ts_context.is_none() {
- return Sub::<Duration>::sub(Local::now(), Duration::days(1));
+ return Sub::<Duration>::sub(Local::now(), Duration::try_days(1).unwrap());
}
let ts_context = ts_context.unwrap();
@@ -226,7 +226,7 @@ fn get_timestamp_from_event_or_default(
match DateTime::parse_from_str(ts_context, TIMESTAMP_FORMAT) {
Ok(ts) => ts.into(),
- Err(_) => Sub::<Duration>::sub(Local::now(), Duration::days(1)),
+ Err(_) => Sub::<Duration>::sub(Local::now(), Duration::try_days(1).unwrap()),
}
}