@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.
@@ -662,9 +662,11 @@ export class EventStore {
662
662
  loadEvents(events) {
663
663
  this.clear();
664
664
 
665
+ this.startBatch();
665
666
  for (const eventData of events) {
666
667
  this.addEvent(eventData);
667
668
  }
669
+ this.commitBatch();
668
670
  }
669
671
 
670
672
  /**
@@ -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.substr(0, 4);
335
- const month = dateString.substr(4, 2);
336
- const day = dateString.substr(6, 2);
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.substr(0, 4));
342
- const month = parseInt(dateString.substr(4, 2)) - 1;
343
- const day = parseInt(dateString.substr(6, 2));
344
- const hour = parseInt(dateString.substr(9, 2)) || 0;
345
- const minute = parseInt(dateString.substr(11, 2)) || 0;
346
- const second = parseInt(dateString.substr(13, 2)) || 0;
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.substr(0, this.maxLineLength));
400
- remaining = remaining.substr(this.maxLineLength);
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.substr(0, this.maxLineLength - 1);
404
+ const chunk = remaining.substring(0, this.maxLineLength - 1);
405
405
  folded.push(` ${chunk}`);
406
- remaining = remaining.substr(chunk.length);
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).substr(2, 9);
446
+ const random = Math.random().toString(36).substring(2, 11);
447
447
  return `${timestamp}-${random}@lightning-calendar`;
448
448
  }
449
449
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forcecalendar/core",
3
- "version": "2.1.50",
3
+ "version": "2.1.52",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "A modern, lightweight, framework-agnostic calendar engine optimized for Salesforce",