diff options
author | Canop <cano.petrole@gmail.com> | 2022-12-15 15:57:30 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2022-12-15 15:57:30 +0100 |
commit | e4097c9d09b6df41203b0ca99fc3b728a0ca8970 (patch) | |
tree | d796537d7570df5ae72b0c0d465eed63c2f3ab60 /src/display | |
parent | b93d834433dcef2dc3dfc4e9695290d87473fc6f (diff) |
allow going to help with just `?` on Windows
Diffstat (limited to 'src/display')
-rw-r--r-- | src/display/displayable_tree.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/display/displayable_tree.rs b/src/display/displayable_tree.rs index 5e8696e..f4f4974 100644 --- a/src/display/displayable_tree.rs +++ b/src/display/displayable_tree.rs @@ -18,7 +18,7 @@ use { task_sync::ComputationResult, tree::{Tree, TreeLine, TreeLineType}, }, - chrono::{DateTime, Local, TimeZone}, + chrono::{DateTime, Local, LocalResult, TimeZone}, crokey::crossterm::{ cursor, QueueableCommand, @@ -222,14 +222,15 @@ impl<'a, 's, 't> DisplayableTree<'a, 's, 't> { seconds: i64, selected: bool, ) -> Result<usize, termimad::Error> { - let date_time: DateTime<Local> = Local.timestamp(seconds, 0); - cond_bg!(date_style, self, selected, self.skin.dates); - cw.queue_g_string( - date_style, - date_time - .format(self.tree.options.date_time_format) - .to_string(), - )?; + if let LocalResult::Single(date_time) = Local.timestamp_opt(seconds, 0) { + cond_bg!(date_style, self, selected, self.skin.dates); + cw.queue_g_string( + date_style, + date_time + .format(self.tree.options.date_time_format) + .to_string(), + )?; + } Ok(1) } |