aboutsummaryrefslogtreecommitdiff
path: root/src/event.rs
diff options
context:
space:
mode:
authorTill Hoeppner2015-06-12 00:00:27 +0200
committerTill Hoeppner2015-06-12 00:00:27 +0200
commitf4d8b1a521c567ccc8e2470299287b063e0d5926 (patch)
tree94e42220872de101ae67a26ee9243cd6e4731386 /src/event.rs
parent6073cd55e7ac0419bcb80bec3c57f2c2409fee02 (diff)
downloadilc-f4d8b1a521c567ccc8e2470299287b063e0d5926.tar.gz
ilc-f4d8b1a521c567ccc8e2470299287b063e0d5926.tar.xz
ilc-f4d8b1a521c567ccc8e2470299287b063e0d5926.zip
Add semi-proper conversion
Diffstat (limited to 'src/event.rs')
-rw-r--r--src/event.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/event.rs b/src/event.rs
index a1c15c2..9c59df2 100644
--- a/src/event.rs
+++ b/src/event.rs
@@ -17,6 +17,7 @@
use std::borrow::Cow;
+use chrono::naive::time::NaiveTime;
use chrono::offset::fixed::FixedOffset;
use chrono::offset::TimeZone;
@@ -47,7 +48,8 @@ impl Time {
pub fn with_format(&self, tz: &FixedOffset, f: &str) -> String {
match self {
&Time::Unknown => panic!("Time data for this event is not present"),
- &Time::Hms(_h, _m, _s) => unimplemented!(),
+ &Time::Hms(h, m, s) => format!("{}",
+ NaiveTime::from_hms(h as u32, m as u32, s as u32).format(f)),
&Time::Timestamp(t) => format!("{}", tz.timestamp(t, 0).format(f))
}
}