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

time: fix logic

This commit is contained in:
Swastik Baranwal 2020-01-14 22:42:28 +05:30 committed by Alexander Medvednikov
parent 2741c0b211
commit 26374971ab

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
}