Current section
Files
Jump to
Current section
Files
src/tempo/year.gleam
pub fn is_leap_year(year: Int) -> Bool {
case year % 4 == 0 {
True ->
case year % 100 == 0 {
True ->
case year % 400 == 0 {
True -> True
False -> False
}
False -> True
}
False -> False
}
}
pub fn days(of year: Int) -> Int {
case is_leap_year(year) {
True -> 366
False -> 365
}
}