aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuben Pollan2018-08-25 19:08:54 +0200
committerRuben Pollan2018-08-25 19:08:54 +0200
commit53034be0511b00b73cd7d3780083996022e4adbb (patch)
treec2c44c634a8e92eb9c0c2f980f684dfb3fd37742 /src
parentb663d054d266ebea589ad38a28d7fbb17c44d7db (diff)
Add empty date creator
Diffstat (limited to 'src')
-rw-r--r--src/event.rs8
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) => {