1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fix time_test.v

This commit is contained in:
Alexander Medvednikov 2019-07-14 17:08:14 +02:00
parent 6c2e313155
commit 7fa1f423e2

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]
}
} }