Add Halloween event

This commit is contained in:
IsseW 2022-10-09 21:35:04 +02:00 committed by flo666
parent 8d8d9309b0
commit 1d6b7d6a03

View File

@ -6,6 +6,7 @@ use serde::{Deserialize, Serialize};
#[repr(u16)]
pub enum CalendarEvent {
Christmas = 0,
Halloween = 1,
}
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
@ -37,6 +38,10 @@ impl Calendar {
this.events.push(CalendarEvent::Christmas);
}
if now.month() == 10 && (01..=31).contains(&now.day()) {
this.events.push(CalendarEvent::Halloween);
}
this
}
}