1 Commits

Author SHA1 Message Date
e62afcd667 Fix calendar prev/forward month buttons 2024-06-19 00:38:54 -04:00

View File

@@ -75,12 +75,12 @@ func (this *Calendar) OnEdit (callback func ()) {
}
func (this *Calendar) prevMonth () {
this.time = firstOfMonth(this.time.Add(24 * time.Hour * 40))
this.time = firstOfMonth(this.time.Add(24 * time.Hour * -20))
this.refresh()
}
func (this *Calendar) nextMonth () {
this.time = firstOfMonth(this.time.Add(24 * time.Hour * -20))
this.time = firstOfMonth(this.time.Add(24 * time.Hour * 40))
this.refresh()
}
@@ -125,9 +125,9 @@ func (this *Calendar) refresh () {
func (this *Calendar) handleScroll (x, y float64) {
if y < 0 {
this.nextMonth()
} else {
this.prevMonth()
} else {
this.nextMonth()
}
}