summaryrefslogtreecommitdiffstats
path: root/src/date.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/date.rs')
-rw-r--r--src/date.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/date.rs b/src/date.rs
index 970e89c..ca3c59d 100644
--- a/src/date.rs
+++ b/src/date.rs
@@ -8,9 +8,17 @@ use serde::de::Visitor;
use serde::de::Error as SerdeError;
use chrono::naive::datetime::NaiveDateTime;
-#[derive(Clone, Debug, Hash)]
+#[derive(Clone, Debug, Hash, Eq, PartialEq)]
pub struct Date(NaiveDateTime);
+impl From<NaiveDateTime> for Date {
+
+ fn from(ndt: NaiveDateTime) -> Date {
+ Date(ndt)
+ }
+
+}
+
pub static TASKWARRIOR_DATETIME_TEMPLATE : &'static str = "%Y%m%dT%H%M%SZ";
impl Serialize for Date {