diff options
author | Ruben Pollan | 2018-08-25 19:08:54 +0200 |
---|---|---|
committer | Ruben Pollan | 2018-08-25 19:08:54 +0200 |
commit | 53034be0511b00b73cd7d3780083996022e4adbb (patch) | |
tree | c2c44c634a8e92eb9c0c2f980f684dfb3fd37742 /src | |
parent | b663d054d266ebea589ad38a28d7fbb17c44d7db (diff) |
Add empty date creator
Diffstat (limited to 'src')
-rw-r--r-- | src/event.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/event.rs b/src/event.rs index b43f28d..066b691 100644 --- a/src/event.rs +++ b/src/event.rs @@ -40,8 +40,8 @@ impl Event { location: "".to_string(), description: "".to_string(), status: Status::Confirmed, - start: Date::Time(UTC.timestamp(0, 0)), - end: Date::Time(UTC.timestamp(0, 0)), + start: Date::empty(), + end: Date::empty(), }; } } @@ -60,6 +60,10 @@ impl fmt::Display for Event { } impl Date { + pub fn empty() -> Date { + Date::Time(UTC.timestamp(0, 0)) + } + pub fn cmp(&self, other: &Self) -> Ordering { match *self { Date::Time(t1) => { |