Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
if (typeof curr.start.toISOString === 'function') {
try {
rule += ';DTSTART=' + curr.start.toISOString().replace(/[-:]/g, '');
rule = rule.replace(/\.[0-9]{3}/, '');
} catch (error) {
console.error("ERROR when trying to convert to ISOString", error);
}
} else {
console.error("No toISOString function in curr.start", curr.start);
}
}
curr.rrule = rrule.fromString(rule);
}
}
return originalEnd.call(this, val, params, curr, stack);
}
private initRecurrenceRuleExplanations(): void {
let rRules = document.getElementsByClassName('rrule-text');
for (let i = 0; i < rRules.length; i++) {
let recurrenceString = rRules[i].getAttribute("data-rrule");
if (recurrenceString) {
let rule = RRule.fromString(recurrenceString);
rRules[i].textContent = rule.toText()
}
}
}
{(() => {
if (
!dataset.accrualPeriodicity
)
return "[NOT SET]";
if (
dataset.accrualPeriodicity !==
"custom"
)
return dataset.accrualPeriodicity;
if (
!dataset.accrualPeriodicityRecurrenceRule
)
return "[NOT SET]";
const r = RRule.fromString(
dataset.accrualPeriodicityRecurrenceRule
);
return r.toText();
})()}