aboutsummaryrefslogtreecommitdiff
path: root/karlc
diff options
context:
space:
mode:
authormetamuffin <yvchraiqi@protonmail.com>2022-06-14 13:58:09 +0200
committermetamuffin <yvchraiqi@protonmail.com>2022-06-14 13:58:09 +0200
commit09ee50601311c802e67e1f7b0a5278c334d2e406 (patch)
tree12325eda3288e08c16ffd85cce0aaa3ff4344be9 /karlc
parenta7abc26af31b69db06a5875fc3fbc756adc838b1 (diff)
downloadkarlender-09ee50601311c802e67e1f7b0a5278c334d2e406.tar
karlender-09ee50601311c802e67e1f7b0a5278c334d2e406.tar.bz2
karlender-09ee50601311c802e67e1f7b0a5278c334d2e406.tar.zst
dynamic scheduling
Diffstat (limited to 'karlc')
-rw-r--r--karlc/src/main.rs25
1 files changed, 24 insertions, 1 deletions
diff --git a/karlc/src/main.rs b/karlc/src/main.rs
index 501ef3c..4501c56 100644
--- a/karlc/src/main.rs
+++ b/karlc/src/main.rs
@@ -96,7 +96,30 @@ fn main() {
print!(" \x1b[38;2;100;255;100mSchedule: \x1b[0m");
match t.schedule {
Schedule::Never => println!("\x1b[3m\x1b[2m(never)\x1b[0m"),
- Schedule::Dynamic { .. } => todo!(),
+ Schedule::Dynamic {
+ duration,
+ priority,
+ scheduled,
+ ..
+ } => {
+ // TODO dont ignore condition
+ println!("dynamicly scheduled",);
+ println!(" \x1b[38;2;100;255;100mPriority:\x1b[0m {priority}");
+ println!(
+ " \x1b[38;2;100;255;100mDuration:\x1b[0m {:?}",
+ std::time::Duration::from_secs(duration as u64)
+ );
+ println!(
+ " \x1b[38;2;100;255;100mScheduled for:\x1b[0m {}",
+ scheduled
+ .map(|r| format!(
+ "{} - {}",
+ NaiveDateTime::from_timestamp(r.start, 0),
+ NaiveDateTime::from_timestamp(r.end, 0)
+ ))
+ .unwrap_or("...".to_string())
+ );
+ }
Schedule::Static(t) => {
println!(
"from {} to {}",