From 3a4b2bde8056339744372757e1fed4bf15cf3302 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 16 Sep 2017 12:36:47 +0200 Subject: Add TimeType::today() --- src/timetype.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/timetype.rs b/src/timetype.rs index b0a5967..05d9015 100644 --- a/src/timetype.rs +++ b/src/timetype.rs @@ -93,6 +93,11 @@ impl SubAssign for TimeType { /// impl TimeType { + /// Alias for `TimeType::moment(::chrono::offset::Local::now().naive_local())` + pub fn today() -> TimeType { + TimeType::moment(::chrono::offset::Local::now().naive_local()) + } + pub fn is_a_amount(&self) -> bool { match *self { TimeType::Seconds(_) | -- cgit v1.2.3