diff options
Diffstat (limited to 'src/time_crate/mod.rs')
-rw-r--r-- | src/time_crate/mod.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/time_crate/mod.rs b/src/time_crate/mod.rs new file mode 100644 index 0000000..a26cd11 --- /dev/null +++ b/src/time_crate/mod.rs @@ -0,0 +1,24 @@ +// Because time (indirectly) depends on this crate, we can't depend on time +// here. As such, we need to copy the functions over. If/when proc macros can be +// declared in the same crate, this will no longer be necessary. + +mod date; + +pub(crate) use date::{days_in_year, days_in_year_month, weeks_in_year, Date}; + +#[derive(PartialEq)] +pub(crate) enum Weekday { + Monday, + Tuesday, + Wednesday, + Thursday, + Friday, + Saturday, + Sunday, +} + +impl Weekday { + pub(crate) const fn iso_weekday_number(self) -> u8 { + self as u8 + 1 + } +} |