time: fix error: array index out of range

pull/3292/head
sh0f 2020-01-01 14:27:48 +08:00 committed by Alexander Medvednikov
parent abe4898b4a
commit a99f214a0f
1 changed files with 3 additions and 0 deletions

View File

@ -88,6 +88,9 @@ fn calculate_date_from_offset(day_offset_ int) (int, int, int) {
estimated_month++
}
for day_offset <= days_before[estimated_month] {
if estimated_month == 0 {
break
}
estimated_month--
}