I am using a RG to create a calendar. I want the calendar to show 6 rows of dates if the current month requires it, but if not, only 4 or 5 rows (depending on whether the 5th row is needed). Any ideas?
Just show 6 always…the movement in element height between 4,5 or 6 when user paginates months is a poor UX…make the previous month and next month dates a grey color to distinguish from current selected months dates
You can calculate it instead of hardcoding.
Offset: Current month start :extract day of week minus 1 (Sunday start).
Days: Current month start +1 month -1 day :extract day.
Add them. 35 or less = 5 rows, 36+ = 6 rows.
Then keep your 42 date list and slice it: List of dates :items until # (rows x 7), with the RG on full list vertical scrolling. On the UX point, the jump isn’t the shorter calendar, it’s the content below moving. Fixed height container with the cells stretching gives you both.
Also 4 rows basically never happens, only if February starts exactly on your first weekday. So realistically you’re toggling 5 and 6.