Returns the ISO weekday after validating the date.
weekday :: (value: Date) -> Weekday
day, _ := date(2024, 3, 11); assert(weekday(day) == .MONDAY);