Created Item (enum of either a task or en event)
This commit is contained in:
parent
e60ad19fa5
commit
571420126f
7 changed files with 257 additions and 112 deletions
29
src/event.rs
Normal file
29
src/event.rs
Normal file
|
@ -0,0 +1,29 @@
|
|||
//! Calendar events
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use chrono::{Utc, DateTime};
|
||||
|
||||
use crate::item::ItemId;
|
||||
|
||||
/// TODO: implement Event one day.
|
||||
/// This crate currently only supports tasks, not calendar events.
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Event {
|
||||
id: ItemId,
|
||||
name: String,
|
||||
last_modified: DateTime<Utc>,
|
||||
}
|
||||
|
||||
impl Event {
|
||||
pub fn id(&self) -> &ItemId {
|
||||
&self.id
|
||||
}
|
||||
|
||||
pub fn name(&self) -> &str {
|
||||
&self.name
|
||||
}
|
||||
|
||||
pub fn last_modified(&self) -> DateTime<Utc> {
|
||||
self.last_modified
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue