From e62afcd6670c9682f3a44d1ea692126861b823bd Mon Sep 17 00:00:00 2001 From: "sashakoshka@tebibyte.media" Date: Wed, 19 Jun 2024 00:38:54 -0400 Subject: [PATCH] Fix calendar prev/forward month buttons --- calendar.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/calendar.go b/calendar.go index 818881b..06aff74 100644 --- a/calendar.go +++ b/calendar.go @@ -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() } }