Julio Biason
4 years ago
7 changed files with 7 additions and 127 deletions
@ -1,53 +0,0 @@ |
|||||||
/* |
|
||||||
TU - Time's Up! |
|
||||||
Copyright (C) 2020 Julio Biason |
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
|
||||||
it under the terms of the GNU Affero General Public License as published by |
|
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU Affero General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License |
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/ |
|
||||||
|
|
||||||
use chrono::prelude::*; |
|
||||||
use chrono::DateTime; |
|
||||||
use serde_derive::Deserialize; |
|
||||||
use serde_derive::Serialize; |
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)] |
|
||||||
pub struct Date { |
|
||||||
year: i32, |
|
||||||
month: u32, |
|
||||||
day: u32, |
|
||||||
} |
|
||||||
|
|
||||||
impl From<&DateTime<Local>> for Date { |
|
||||||
fn from(origin: &DateTime<Local>) -> Date { |
|
||||||
Date { |
|
||||||
year: origin.year(), |
|
||||||
month: origin.month(), |
|
||||||
day: origin.day(), |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
impl Date { |
|
||||||
pub fn year(&self) -> i32 { |
|
||||||
self.year |
|
||||||
} |
|
||||||
|
|
||||||
pub fn month(&self) -> u32 { |
|
||||||
self.month |
|
||||||
} |
|
||||||
|
|
||||||
pub fn day(&self) -> u32 { |
|
||||||
self.day |
|
||||||
} |
|
||||||
} |
|
@ -1,47 +0,0 @@ |
|||||||
/* |
|
||||||
TU - Time's Up! |
|
||||||
Copyright (C) 2020 Julio Biason |
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
|
||||||
it under the terms of the GNU Affero General Public License as published by |
|
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU Affero General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License |
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/ |
|
||||||
|
|
||||||
use chrono::prelude::*; |
|
||||||
use chrono::DateTime; |
|
||||||
use serde_derive::Deserialize; |
|
||||||
use serde_derive::Serialize; |
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)] |
|
||||||
pub struct Time { |
|
||||||
hour: u32, |
|
||||||
min: u32, |
|
||||||
} |
|
||||||
|
|
||||||
impl From<&DateTime<Local>> for Time { |
|
||||||
fn from(origin: &DateTime<Local>) -> Time { |
|
||||||
Time { |
|
||||||
hour: origin.hour(), |
|
||||||
min: origin.minute(), |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
impl Time { |
|
||||||
pub fn hour(&self) -> u32 { |
|
||||||
self.hour |
|
||||||
} |
|
||||||
|
|
||||||
pub fn minute(&self) -> u32 { |
|
||||||
self.min |
|
||||||
} |
|
||||||
} |
|
@ -1,20 +0,0 @@ |
|||||||
/* |
|
||||||
TU - Time's Up! |
|
||||||
Copyright (C) 2020 Julio Biason |
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify |
|
||||||
it under the terms of the GNU Affero General Public License as published by |
|
||||||
the Free Software Foundation, either version 3 of the License, or |
|
||||||
(at your option) any later version. |
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, |
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||||
GNU Affero General Public License for more details. |
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License |
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/ |
|
||||||
|
|
||||||
pub mod event; |
|
||||||
pub mod eventlist; |
|
Loading…
Reference in new issue