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:
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
|
||||
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user