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:
parent
6c2e313155
commit
7fa1f423e2
@ -336,10 +336,7 @@ pub fn days_in_month(month, year int) ?int {
|
||||
if month > 12 || month < 1 {
|
||||
return error('Invalid month: $month')
|
||||
}
|
||||
|
||||
if month == 2 {
|
||||
return MonthDays[month-1] + if is_leap_year(year) {1} else {0}
|
||||
} else {
|
||||
return MonthDays[month-1]
|
||||
}
|
||||
extra := if month == 2 && is_leap_year(year) {1} else {0}
|
||||
res := MonthDays[month-1] + extra
|
||||
return res
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user