@forcecalendar/core 2.1.40 → 2.1.41

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.
@@ -304,10 +304,20 @@ export class RecurrenceEngineV2 {
304
304
  } else if (rule.byDay && rule.byDay.length > 0) {
305
305
  // Nth weekday of month (e.g., "2nd Tuesday")
306
306
  const byDay = rule.byDay[0];
307
- const nthOccurrence = byDay.nth || 1;
307
+ let weekday, nthOccurrence;
308
+
309
+ if (typeof byDay === 'string') {
310
+ // Parse string format from RRuleParser: "MO", "2TU", "-1FR"
311
+ const match = byDay.match(/^(-?\d*)([A-Z]{2})$/);
312
+ weekday = match ? match[2] : byDay;
313
+ nthOccurrence = match && match[1] ? parseInt(match[1], 10) : 1;
314
+ } else {
315
+ weekday = byDay.weekday;
316
+ nthOccurrence = byDay.nth || 1;
317
+ }
308
318
 
309
319
  next.setMonth(next.getMonth() + rule.interval);
310
- this.setToNthWeekdayOfMonth(next, byDay.weekday, nthOccurrence);
320
+ this.setToNthWeekdayOfMonth(next, weekday, nthOccurrence);
311
321
  } else if (rule.bySetPos && rule.bySetPos.length > 0) {
312
322
  // BYSETPOS for selecting from set
313
323
  next.setMonth(next.getMonth() + rule.interval);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forcecalendar/core",
3
- "version": "2.1.40",
3
+ "version": "2.1.41",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "A modern, lightweight, framework-agnostic calendar engine optimized for Salesforce",