summaryrefslogtreecommitdiffstats
path: root/src/timetype.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-09-16 12:36:47 +0200
committerMatthias Beyer <mail@beyermatthias.de>2017-09-16 12:36:47 +0200
commit3a4b2bde8056339744372757e1fed4bf15cf3302 (patch)
tree0734a2b012fa9fb64f5e4f4db2b13291b6e162e0 /src/timetype.rs
parenta0f82c62916e26804ef38e6584e9b75f383cb485 (diff)
Add TimeType::today()
Diffstat (limited to 'src/timetype.rs')
-rw-r--r--src/timetype.rs5
1 files changed, 5 insertions, 0 deletions
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(_) |