time: fix logic

pull/3450/head
Swastik Baranwal 2020-01-14 22:42:28 +05:30 committed by Alexander Medvednikov
parent 2741c0b211
commit 26374971ab
1 changed files with 2 additions and 2 deletions

View File

@ -84,10 +84,10 @@ fn calculate_date_from_offset(day_offset_ int) (int, int, int) {
}
mut estimated_month := day_offset / 31
for day_offset > days_before[estimated_month+1] {
for day_offset >= days_before[estimated_month+1] {
estimated_month++
}
for day_offset <= days_before[estimated_month] {
for day_offset < days_before[estimated_month] {
if estimated_month == 0 {
break
}