MCPcopy Create free account
hub / github.com/DHTMLX/scheduler / parseLine

Function parseLine

codebase/sources/dhtmlxscheduler.es.js:17050–17068  ·  view source on GitHub ↗
(rfcString)

Source from the content-addressed store, hash-verified

17048 return options;
17049}
17050function parseLine(rfcString) {
17051 rfcString = rfcString.replace(/^\s+|\s+$/, "");
17052 if (!rfcString.length)
17053 return null;
17054 var header = /^([A-Z]+?)[:;]/.exec(rfcString.toUpperCase());
17055 if (!header) {
17056 return parseRrule(rfcString);
17057 }
17058 var key = header[1];
17059 switch (key.toUpperCase()) {
17060 case "RRULE":
17061 case "EXRULE":
17062 return parseRrule(rfcString);
17063 case "DTSTART":
17064 return parseDtstart(rfcString);
17065 default:
17066 throw new Error("Unsupported RFC prop ".concat(key, " in ").concat(rfcString));
17067 }
17068}
17069function parseRrule(line) {
17070 var strippedLine = line.replace(/^RRULE:/i, "");
17071 var options = parseDtstart(strippedLine);

Callers

nothing calls this directly

Calls 2

parseRruleFunction · 0.70
parseDtstartFunction · 0.70

Tested by

no test coverage detected