From 4ea0b98cc28a0504d35108b3bf539bb47ed995e6 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 28 May 2016 20:21:42 +0200 Subject: [PATCH] Impl Date --- libimagtimeui/src/date.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/libimagtimeui/src/date.rs b/libimagtimeui/src/date.rs index ea28479c..fb2e57cc 100644 --- a/libimagtimeui/src/date.rs +++ b/libimagtimeui/src/date.rs @@ -10,8 +10,24 @@ pub struct Date { impl Date { - fn new(year: i32, month: u32, day: u32) -> Date { - unimplemented!() + pub fn new(year: i32, month: u32, day: u32) -> Date { + Date { + year: year, + month: month, + day: day, + } + } + + pub fn year(&self) -> i32 { + self.year + } + + pub fn month(&self) -> u32 { + self.month + } + + pub fn day(&self) -> u32 { + self.day } }