@forcecalendar/core 2.1.50 → 2.1.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/events/EventStore.js +2 -0
- package/core/ics/ICSParser.js +14 -14
- package/package.json +1 -1
package/core/ics/ICSParser.js
CHANGED
|
@@ -331,19 +331,19 @@ export class ICSParser {
|
|
|
331
331
|
// Check if it's a date-only value
|
|
332
332
|
if (property.includes('VALUE=DATE') || dateString.length === 8) {
|
|
333
333
|
// YYYYMMDD format
|
|
334
|
-
const year = dateString.
|
|
335
|
-
const month = dateString.
|
|
336
|
-
const day = dateString.
|
|
334
|
+
const year = dateString.substring(0, 4);
|
|
335
|
+
const month = dateString.substring(4, 6);
|
|
336
|
+
const day = dateString.substring(6, 8);
|
|
337
337
|
return new Date(year, month - 1, day);
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
// Full datetime: YYYYMMDDTHHMMSS[Z]
|
|
341
|
-
const year = parseInt(dateString.
|
|
342
|
-
const month = parseInt(dateString.
|
|
343
|
-
const day = parseInt(dateString.
|
|
344
|
-
const hour = parseInt(dateString.
|
|
345
|
-
const minute = parseInt(dateString.
|
|
346
|
-
const second = parseInt(dateString.
|
|
341
|
+
const year = parseInt(dateString.substring(0, 4));
|
|
342
|
+
const month = parseInt(dateString.substring(4, 6)) - 1;
|
|
343
|
+
const day = parseInt(dateString.substring(6, 8));
|
|
344
|
+
const hour = parseInt(dateString.substring(9, 11)) || 0;
|
|
345
|
+
const minute = parseInt(dateString.substring(11, 13)) || 0;
|
|
346
|
+
const second = parseInt(dateString.substring(13, 15)) || 0;
|
|
347
347
|
|
|
348
348
|
if (dateString.endsWith('Z')) {
|
|
349
349
|
// UTC time
|
|
@@ -396,14 +396,14 @@ export class ICSParser {
|
|
|
396
396
|
let remaining = line;
|
|
397
397
|
|
|
398
398
|
// First line
|
|
399
|
-
folded.push(remaining.
|
|
400
|
-
remaining = remaining.
|
|
399
|
+
folded.push(remaining.substring(0, this.maxLineLength));
|
|
400
|
+
remaining = remaining.substring(this.maxLineLength);
|
|
401
401
|
|
|
402
402
|
// Continuation lines (with space prefix)
|
|
403
403
|
while (remaining.length > 0) {
|
|
404
|
-
const chunk = remaining.
|
|
404
|
+
const chunk = remaining.substring(0, this.maxLineLength - 1);
|
|
405
405
|
folded.push(` ${chunk}`);
|
|
406
|
-
remaining = remaining.
|
|
406
|
+
remaining = remaining.substring(chunk.length);
|
|
407
407
|
}
|
|
408
408
|
|
|
409
409
|
return folded.join('\r\n');
|
|
@@ -443,7 +443,7 @@ export class ICSParser {
|
|
|
443
443
|
*/
|
|
444
444
|
generateUID() {
|
|
445
445
|
const timestamp = Date.now().toString(36);
|
|
446
|
-
const random = Math.random().toString(36).
|
|
446
|
+
const random = Math.random().toString(36).substring(2, 11);
|
|
447
447
|
return `${timestamp}-${random}@lightning-calendar`;
|
|
448
448
|
}
|
|
449
449
|
|