summaryrefslogtreecommitdiff
path: root/lib/domain/libimagdiary/src/diaryid.rs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/domain/libimagdiary/src/diaryid.rs')
-rw-r--r--lib/domain/libimagdiary/src/diaryid.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/domain/libimagdiary/src/diaryid.rs b/lib/domain/libimagdiary/src/diaryid.rs
index c28aebd..727bb52 100644
--- a/lib/domain/libimagdiary/src/diaryid.rs
+++ b/lib/domain/libimagdiary/src/diaryid.rs
@@ -132,6 +132,14 @@ impl DiaryId {
self
}
+ /// Get the date how it is stored in the DiaryId object
+ ///
+ /// This can be useful for sorting a list of diary entries by date, but not using
+ /// Into<NaiveDateTime>
+ pub fn get_date_representation(&self) -> (i32, u32, u32, u32, u32, u32) {
+ (self.year, self.month, self.day, self.hour, self.minute, self.second)
+ }
+
pub fn now(name: String) -> DiaryId {
use chrono::offset::Local;