fix time_test.v

pull/1141/head
Alexander Medvednikov 2019-07-14 17:08:14 +02:00
parent 6c2e313155
commit 7fa1f423e2
1 changed files with 3 additions and 6 deletions

View File

@ -336,10 +336,7 @@ pub fn days_in_month(month, year int) ?int {
if month > 12 || month < 1 { if month > 12 || month < 1 {
return error('Invalid month: $month') return error('Invalid month: $month')
} }
extra := if month == 2 && is_leap_year(year) {1} else {0}
if month == 2 { res := MonthDays[month-1] + extra
return MonthDays[month-1] + if is_leap_year(year) {1} else {0} return res
} else {
return MonthDays[month-1]
}
} }