summaryrefslogtreecommitdiff
path: root/src/works
diff options
context:
space:
mode:
authorWriterV2 <primary-v2@protonmail.com>2023-12-21 11:58:07 +0100
committerWriterV2 <primary-v2@protonmail.com>2023-12-21 11:58:07 +0100
commit19c2c05c6f5220f4feedad99a38e0fb4dc57b957 (patch)
tree0f2ee6bf574ccdb8d68261db597e0f356f478c9a /src/works
parent3e48a7f4d1bf7d13206ccfb54a3efbe469cc565a (diff)
Adapt to new timestamp function which returns the date as an option
Diffstat (limited to 'src/works')
-rw-r--r--src/works/stories.rs6
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)
}