~ruther/simple-clock

2efb21b56ba8335d924100ee52d616e9f94fd9ac — František Boháček 1 year, 10 months ago d6c87cb
feat(src): add calendar freezing possibility
1 files changed, 8 insertions(+), 0 deletions(-)

M source/src/calendar.rs
M source/src/calendar.rs => source/src/calendar.rs +8 -0
@@ 232,6 232,14 @@ impl Calendar {
        matches!(year % 4, 0 if year % 100 != 0 || year % 400 == 0)
    }

    pub fn freeze(&mut self) {
        self.frozen = true;
    }

    pub fn unfreeze(&mut self) {
        self.frozen = true;
    }

    fn days_in_month(month: u8, leap_year: bool) -> u8 {
        match month {
            2 if leap_year => 29,

Do not follow this link