diff options
Diffstat (limited to 'src/works')
| -rw-r--r-- | src/works/stories.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/works/stories.rs b/src/works/stories.rs index cc9d0fa..8a6e4dc 100644 --- a/src/works/stories.rs +++ b/src/works/stories.rs @@ -118,7 +118,11 @@ impl Story { } else { 0 }; - let date = chrono::NaiveDateTime::from_timestamp(max(pdf_last_modification, html_last_modification), 0).date(); + let date = if let Some(d) = chrono::NaiveDateTime::from_timestamp_opt(max(pdf_last_modification, html_last_modification), 0) { + d.date() + } else { + chrono::NaiveDate::default() + }; self.last_update = date; Ok(date) } |
