How to use the rrule.RRule.fromString function in rrule

To help you get started, we’ve selected a few rrule examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eouia / MMM-CalendarExt / vendor / ical.js / node-ical.js View on Github external
}
				}


				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);
}
github JustaPenguin / assetto-server-manager / cmd / server-manager / typescript / src / RaceList.ts View on Github external
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()
            }
        }
    }
github magda-io / magda / magda-web-client / src / Components / Dataset / DatasetPage.js View on Github external
{(() => {
                                                    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();
                                                })()}