@forcecalendar/core 2.1.67 → 2.1.69
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/calendar/DateUtils.js +1 -13
- package/core/conflicts/ConflictDetector.js +0 -3
- package/core/events/Event.js +2 -4
- package/core/events/RecurrenceEngine.js +2 -2
- package/core/index.js +1 -1
- package/core/integration/EnhancedCalendar.js +0 -13
- package/core/performance/AdaptiveMemoryManager.js +2 -2
- package/core/search/EventSearch.js +1 -1
- package/package.json +1 -1
|
@@ -507,7 +507,7 @@ export class DateUtils {
|
|
|
507
507
|
* @param {string} timeZone - IANA timezone string
|
|
508
508
|
* @returns {Date}
|
|
509
509
|
*/
|
|
510
|
-
static addHoursWithDST(date, hours,
|
|
510
|
+
static addHoursWithDST(date, hours, _timeZone) {
|
|
511
511
|
const result = new Date(date);
|
|
512
512
|
|
|
513
513
|
// UTC millisecond arithmetic is inherently DST-agnostic.
|
|
@@ -534,18 +534,6 @@ export class DateUtils {
|
|
|
534
534
|
const dateStr = `${year}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`;
|
|
535
535
|
const timeStr = `${String(hour).padStart(2, '0')}:${String(minute).padStart(2, '0')}:${String(second).padStart(2, '0')}`;
|
|
536
536
|
|
|
537
|
-
// Use Intl API to get the UTC time for this local time in the timezone
|
|
538
|
-
const formatter = new Intl.DateTimeFormat('en-US', {
|
|
539
|
-
timeZone,
|
|
540
|
-
year: 'numeric',
|
|
541
|
-
month: '2-digit',
|
|
542
|
-
day: '2-digit',
|
|
543
|
-
hour: '2-digit',
|
|
544
|
-
minute: '2-digit',
|
|
545
|
-
second: '2-digit',
|
|
546
|
-
hour12: false
|
|
547
|
-
});
|
|
548
|
-
|
|
549
537
|
// Parse the local date in the target timezone
|
|
550
538
|
const localDate = new Date(`${dateStr}T${timeStr}`);
|
|
551
539
|
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
* ConflictDetector - Detects scheduling conflicts between events
|
|
3
3
|
* Checks for time overlaps, attendee conflicts, and resource conflicts
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
import { DateUtils } from '../calendar/DateUtils.js';
|
|
7
|
-
|
|
8
5
|
export class ConflictDetector {
|
|
9
6
|
/**
|
|
10
7
|
* Create a new ConflictDetector
|
package/core/events/Event.js
CHANGED
|
@@ -366,8 +366,6 @@ export class Event {
|
|
|
366
366
|
* @param {string} [timezone] - Timezone for the new dates
|
|
367
367
|
*/
|
|
368
368
|
updateTimes(start, end, timezone) {
|
|
369
|
-
const tz = timezone || this.timeZone;
|
|
370
|
-
|
|
371
369
|
this.start = start instanceof Date ? start : new Date(start);
|
|
372
370
|
this.end = end instanceof Date ? end : new Date(end);
|
|
373
371
|
|
|
@@ -477,9 +475,9 @@ export class Event {
|
|
|
477
475
|
throw new Error('Parameter must be an Event instance or have start/end properties');
|
|
478
476
|
}
|
|
479
477
|
|
|
480
|
-
|
|
478
|
+
const thisStart = this.start;
|
|
481
479
|
let thisEnd = this.end;
|
|
482
|
-
|
|
480
|
+
const otherStart = otherEvent.start;
|
|
483
481
|
let otherEnd = otherEvent.end;
|
|
484
482
|
|
|
485
483
|
// Normalize all-day event boundaries for consistent comparison.
|
|
@@ -165,7 +165,7 @@ export class RecurrenceEngine {
|
|
|
165
165
|
* @param {string} [timezone] - Timezone for calculation
|
|
166
166
|
* @returns {Date} Next occurrence date
|
|
167
167
|
*/
|
|
168
|
-
static getNextOccurrence(currentDate, rule,
|
|
168
|
+
static getNextOccurrence(currentDate, rule, _timezone = 'UTC') {
|
|
169
169
|
const next = new Date(currentDate);
|
|
170
170
|
|
|
171
171
|
switch (rule.freq) {
|
|
@@ -331,7 +331,7 @@ export class RecurrenceEngine {
|
|
|
331
331
|
* @param {string} [eventId] - Event ID for better exception tracking
|
|
332
332
|
* @returns {boolean}
|
|
333
333
|
*/
|
|
334
|
-
static isException(date, rule,
|
|
334
|
+
static isException(date, rule, _eventId = null) {
|
|
335
335
|
if (!rule.exceptions || rule.exceptions.length === 0) {
|
|
336
336
|
return false;
|
|
337
337
|
}
|
package/core/index.js
CHANGED
|
@@ -28,7 +28,7 @@ export { RRuleParser } from './events/RRuleParser.js';
|
|
|
28
28
|
export { EnhancedCalendar } from './integration/EnhancedCalendar.js';
|
|
29
29
|
|
|
30
30
|
// Version — keep in sync with package.json
|
|
31
|
-
export const VERSION = '2.1.
|
|
31
|
+
export const VERSION = '2.1.69';
|
|
32
32
|
|
|
33
33
|
// Default export
|
|
34
34
|
export { Calendar as default } from './calendar/Calendar.js';
|
|
@@ -411,19 +411,6 @@ export function createEnhancedCalendar(config) {
|
|
|
411
411
|
calendar.cancelOccurrence('meeting-1', new Date('2024-01-15T10:00:00'), 'Public Holiday');
|
|
412
412
|
|
|
413
413
|
// Example: Advanced search
|
|
414
|
-
calendar
|
|
415
|
-
.advancedSearch('standup', {
|
|
416
|
-
dateRange: {
|
|
417
|
-
start: new Date('2024-01-01'),
|
|
418
|
-
end: new Date('2024-01-31')
|
|
419
|
-
},
|
|
420
|
-
categories: ['meetings'],
|
|
421
|
-
modifiedOnly: false
|
|
422
|
-
})
|
|
423
|
-
.then(results => {
|
|
424
|
-
console.log('Search results:', results);
|
|
425
|
-
});
|
|
426
|
-
|
|
427
414
|
return calendar;
|
|
428
415
|
}
|
|
429
416
|
|
|
@@ -187,7 +187,7 @@ export class AdaptiveMemoryManager {
|
|
|
187
187
|
* Increase cache sizes when memory is available
|
|
188
188
|
*/
|
|
189
189
|
increaseCacheSizes() {
|
|
190
|
-
for (const [name, cacheInfo] of this.caches) {
|
|
190
|
+
for (const [name, cacheInfo] of this.caches.entries()) {
|
|
191
191
|
// Only increase if cache is being actively used
|
|
192
192
|
const timeSinceAccess = Date.now() - cacheInfo.lastAccess;
|
|
193
193
|
if (timeSinceAccess < 60000) {
|
|
@@ -262,7 +262,7 @@ export class AdaptiveMemoryManager {
|
|
|
262
262
|
* Emergency clear all caches
|
|
263
263
|
*/
|
|
264
264
|
emergencyClear() {
|
|
265
|
-
for (const
|
|
265
|
+
for (const cacheInfo of this.caches.values()) {
|
|
266
266
|
if (cacheInfo.cache.clear) {
|
|
267
267
|
cacheInfo.cache.clear();
|
|
268
268
|
}
|