@forcecalendar/core 2.1.42 → 2.1.44

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.
@@ -5,6 +5,7 @@
5
5
 
6
6
  import { ICSParser } from './ICSParser.js';
7
7
  import { Event } from '../events/Event.js';
8
+ import { RecurrenceEngineV2 } from '../events/RecurrenceEngineV2.js';
8
9
 
9
10
  export class ICSHandler {
10
11
  constructor(calendar) {
@@ -380,6 +381,7 @@ export class ICSHandler {
380
381
  const expanded = [];
381
382
  const rangeStart = dateRange?.start || new Date();
382
383
  const rangeEnd = dateRange?.end || new Date(Date.now() + 365 * 24 * 60 * 60 * 1000);
384
+ const recurrenceEngine = new RecurrenceEngineV2();
383
385
 
384
386
  for (const event of events) {
385
387
  if (!(event.recurring || event.recurrenceRule || event.recurrence)) {
@@ -387,26 +389,20 @@ export class ICSHandler {
387
389
  continue;
388
390
  }
389
391
 
390
- // TODO: Get instances from calendar's recurrence engine when implemented
391
- // For now, just include the base event
392
- const instances = [
393
- {
394
- start: event.start,
395
- end: event.end
396
- }
397
- ];
392
+ // Use RecurrenceEngineV2 to expand occurrences within the date range
393
+ const occurrences = recurrenceEngine.expandEvent(event, rangeStart, rangeEnd);
398
394
 
399
- // Add each instance as a separate event
400
- for (const instance of instances) {
395
+ // Add each occurrence as a separate event
396
+ for (const occurrence of occurrences) {
401
397
  expanded.push({
402
398
  ...event,
403
- id: `${event.id}-${instance.start.getTime()}`,
404
- start: instance.start,
405
- end: instance.end,
399
+ id: `${event.id}-${occurrence.start.getTime()}`,
400
+ start: occurrence.start,
401
+ end: occurrence.end,
406
402
  recurring: false,
407
403
  recurrenceRule: null,
408
- recurrence: null, // Remove recurrence from instances
409
- parentId: event.id // Reference to original
404
+ recurrence: null,
405
+ parentId: event.id
410
406
  });
411
407
  }
412
408
  }
@@ -57,7 +57,7 @@ export class EnhancedCalendar extends Calendar {
57
57
  /**
58
58
  * Get events with enhanced recurrence expansion
59
59
  */
60
- async getEventsInRange(startDate, endDate, options = {}) {
60
+ getEventsInRange(startDate, endDate, options = {}) {
61
61
  const startTime = performance.now();
62
62
 
63
63
  const regularEvents = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forcecalendar/core",
3
- "version": "2.1.42",
3
+ "version": "2.1.44",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "A modern, lightweight, framework-agnostic calendar engine optimized for Salesforce",