Fix calendar prev/forward month buttons
This commit is contained in:
parent
f778ef5c95
commit
e62afcd667
@ -75,12 +75,12 @@ func (this *Calendar) OnEdit (callback func ()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *Calendar) prevMonth () {
|
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()
|
this.refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Calendar) nextMonth () {
|
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()
|
this.refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,9 +125,9 @@ func (this *Calendar) refresh () {
|
|||||||
|
|
||||||
func (this *Calendar) handleScroll (x, y float64) {
|
func (this *Calendar) handleScroll (x, y float64) {
|
||||||
if y < 0 {
|
if y < 0 {
|
||||||
this.nextMonth()
|
|
||||||
} else {
|
|
||||||
this.prevMonth()
|
this.prevMonth()
|
||||||
|
} else {
|
||||||
|
this.nextMonth()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user