@forcecalendar/core 2.1.47 → 2.1.49

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.
@@ -473,14 +473,32 @@ export class Event {
473
473
  * @throws {Error} If otherEvent is not an Event instance or doesn't have start/end
474
474
  */
475
475
  overlaps(otherEvent) {
476
- if (otherEvent instanceof Event) {
477
- // Events don't overlap if one ends before the other starts
478
- return !(this.end <= otherEvent.start || this.start >= otherEvent.end);
479
- } else if (otherEvent && otherEvent.start && otherEvent.end) {
480
- // Allow checking against time ranges
481
- return !(this.end <= otherEvent.start || this.start >= otherEvent.end);
482
- }
483
- throw new Error('Parameter must be an Event instance or have start/end properties');
476
+ if (!otherEvent || (!otherEvent.start && !(otherEvent instanceof Event))) {
477
+ throw new Error('Parameter must be an Event instance or have start/end properties');
478
+ }
479
+
480
+ let thisStart = this.start;
481
+ let thisEnd = this.end;
482
+ let otherStart = otherEvent.start;
483
+ let otherEnd = otherEvent.end;
484
+
485
+ // Normalize all-day event boundaries for consistent comparison.
486
+ // All-day events use end=23:59:59.999, but a timed event ending at
487
+ // exactly midnight (00:00:00) of the next day should overlap with
488
+ // an all-day event on the previous day.
489
+ if (this.allDay) {
490
+ thisEnd = new Date(thisEnd);
491
+ thisEnd.setDate(thisEnd.getDate() + 1);
492
+ thisEnd.setHours(0, 0, 0, 0);
493
+ }
494
+ if (otherEvent.allDay) {
495
+ otherEnd = new Date(otherEnd);
496
+ otherEnd.setDate(otherEnd.getDate() + 1);
497
+ otherEnd.setHours(0, 0, 0, 0);
498
+ }
499
+
500
+ // Standard interval overlap: NOT (one ends before or when the other starts)
501
+ return !(thisEnd <= otherStart || thisStart >= otherEnd);
484
502
  }
485
503
 
486
504
  /**
package/core/index.js CHANGED
@@ -27,8 +27,8 @@ export { RRuleParser } from './events/RRuleParser.js';
27
27
  // Enhanced Integration
28
28
  export { EnhancedCalendar } from './integration/EnhancedCalendar.js';
29
29
 
30
- // Version
31
- export const VERSION = '0.4.0';
30
+ // Version — keep in sync with package.json
31
+ export const VERSION = '2.1.24';
32
32
 
33
33
  // Default export
34
34
  export { Calendar as default } from './calendar/Calendar.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forcecalendar/core",
3
- "version": "2.1.47",
3
+ "version": "2.1.49",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "A modern, lightweight, framework-agnostic calendar engine optimized for Salesforce",