Kalender-UI: Berücksichtige INTERVAL und DTSTART bei monatlichen RRULEs.

Der JS-RRULE-Parser im Kalender ignorierte bisher INTERVAL=, sodass
z.B. FREQ=MONTHLY;INTERVAL=3 als reines monatliches Event angezeigt
wurde. Außerdem wurden monatliche Events auch in Monaten vor ihrem
DTSTART angezeigt.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
Hauke Mehrtens 2026-05-03 16:35:17 +02:00
parent 607da4c5fe
commit 0b67ad4cfb

View file

@ -131,6 +131,12 @@ document.addEventListener('DOMContentLoaded', function() {
else if (rruleStr.includes("FREQ=MONTHLY") && rruleStr.includes("BYDAY")) {
const bydayMatch = rruleStr.match(/BYDAY=([^;]+)/);
if (bydayMatch) {
const intervalMatch = rruleStr.match(/INTERVAL=(\d+)/);
const interval = intervalMatch ? parseInt(intervalMatch[1]) : 1;
const monthsFromStart = (year - startDate.getFullYear()) * 12 + (month - startDate.getMonth());
if (monthsFromStart < 0 || monthsFromStart % interval !== 0) {
return [];
}
const bydays = bydayMatch[1].split(',');
const dayMap = {
'MO': 1, 'TU': 2, 'WE': 3, 'TH': 4, 'FR': 5, 'SA': 6, 'SU': 0