Fix "December scrolling past current year" bug

Until this commit there was a bug which caused the current selected
year to change if the user 'L'-ed past the right of December, while
the number of months which can fit into one row did not divide 12.
This commit is contained in:
Petar Kapriš 2021-11-30 20:29:12 +01:00 committed by Петар Каприш
parent 9fa8301ba6
commit 8d38a07348

View file

@ -122,7 +122,7 @@ func MoveDown() {
func MoveRight() { func MoveRight() {
if util.SelTime.Weekday() != time.Sunday && util.SelTime.Day() != lastDay(util.SelTime.Month()).Day() { if util.SelTime.Weekday() != time.Sunday && util.SelTime.Day() != lastDay(util.SelTime.Month()).Day() {
util.SelTime = util.SelTime.AddDate(0, 0, 1) util.SelTime = util.SelTime.AddDate(0, 0, 1)
} else if int(util.SelTime.Month())%monthsWide != 0 { } else if int(util.SelTime.Month())%monthsWide != 0 && int(util.SelTime.Month()) != 12 {
util.SelTime = leftmostInRow(util.SelTime.Month()+1, rowInMonth(util.SelTime.Month(), util.SelTime.Day())) util.SelTime = leftmostInRow(util.SelTime.Month()+1, rowInMonth(util.SelTime.Month(), util.SelTime.Day()))
} }
} }