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:

committed by
Alexander Medvednikov

parent
2741c0b211
commit
26374971ab
@ -84,10 +84,10 @@ fn calculate_date_from_offset(day_offset_ int) (int, int, int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mut estimated_month := day_offset / 31
|
mut estimated_month := day_offset / 31
|
||||||
for day_offset > days_before[estimated_month+1] {
|
for day_offset >= days_before[estimated_month+1] {
|
||||||
estimated_month++
|
estimated_month++
|
||||||
}
|
}
|
||||||
for day_offset <= days_before[estimated_month] {
|
for day_offset < days_before[estimated_month] {
|
||||||
if estimated_month == 0 {
|
if estimated_month == 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user