GOAL: The goal of this thread is to create two (2) mathematical formulas to replace the long-hand solution by @lawlist in the function lawlist-calend
I must be missing something because it looks like the formulas are as simple as (pseudocode):
first = 9 * ( rows - 1 )
second = 6 + 25 * ( cols - 1 )
based on your edit, you can calculate the rows and cols to move with:
if target > display
difference = target - display
else
difference = 12 + target - display
rows = difference / 3
cols = difference % 3
rowmove = 9 * rows
colmove = 6 + 25 * cols
And then use the formula above.
My attempt at elisp:
(let difference (if (>= target-month display-month)
(- target-month display-month)
(- (+ target-month 12) display-month)))
(let rows (/ difference 3))
(let cols (% difference 3))
(let rowmove (* 9 rows))
(let colmove (+ 6 (* 25 cols)))