@forcecalendar/core 2.1.15 → 2.1.17
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.
|
@@ -122,6 +122,13 @@ export class EventStore {
|
|
|
122
122
|
// Store updated event
|
|
123
123
|
this.events.set(eventId, updatedEvent);
|
|
124
124
|
|
|
125
|
+
// Update cache with new event data
|
|
126
|
+
this.optimizer.cache(eventId, updatedEvent, 'event');
|
|
127
|
+
|
|
128
|
+
// Clear query and date range caches since results may have changed
|
|
129
|
+
this.optimizer.queryCache.clear();
|
|
130
|
+
this.optimizer.dateRangeCache.clear();
|
|
131
|
+
|
|
125
132
|
// Re-index
|
|
126
133
|
this._indexEvent(updatedEvent);
|
|
127
134
|
|
|
@@ -150,6 +157,11 @@ export class EventStore {
|
|
|
150
157
|
// Remove from primary storage
|
|
151
158
|
this.events.delete(eventId);
|
|
152
159
|
|
|
160
|
+
// Invalidate caches
|
|
161
|
+
this.optimizer.eventCache.delete(eventId);
|
|
162
|
+
this.optimizer.queryCache.clear();
|
|
163
|
+
this.optimizer.dateRangeCache.clear();
|
|
164
|
+
|
|
153
165
|
// Remove from indices
|
|
154
166
|
this._unindexEvent(event);
|
|
155
167
|
|
|
@@ -345,8 +345,16 @@ export class RecurrenceEngine {
|
|
|
345
345
|
}
|
|
346
346
|
return exceptionDate.toDateString() === dateStr;
|
|
347
347
|
}
|
|
348
|
-
// Simple date exception
|
|
348
|
+
// Simple date exception — if the exception has a specific time component
|
|
349
|
+
// (not midnight), match by timestamp to avoid excluding all occurrences on that day
|
|
349
350
|
const exceptionDate = exDate instanceof Date ? exDate : new Date(exDate);
|
|
351
|
+
const hasTime =
|
|
352
|
+
exceptionDate.getHours() !== 0 ||
|
|
353
|
+
exceptionDate.getMinutes() !== 0 ||
|
|
354
|
+
exceptionDate.getSeconds() !== 0;
|
|
355
|
+
if (hasTime) {
|
|
356
|
+
return Math.abs(exceptionDate.getTime() - dateTime) < 1000;
|
|
357
|
+
}
|
|
350
358
|
return exceptionDate.toDateString() === dateStr;
|
|
351
359
|
});
|
|
352
360
|
}
|
package/core/ics/ICSParser.js
CHANGED
|
@@ -160,7 +160,9 @@ export class ICSParser {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
// Categories
|
|
163
|
-
if (event.
|
|
163
|
+
if (event.categories && event.categories.length > 0) {
|
|
164
|
+
lines.push(`CATEGORIES:${event.categories.join(',')}`);
|
|
165
|
+
} else if (event.category) {
|
|
164
166
|
lines.push(`CATEGORIES:${event.category}`);
|
|
165
167
|
}
|
|
166
168
|
|
|
@@ -246,7 +248,8 @@ export class ICSParser {
|
|
|
246
248
|
break;
|
|
247
249
|
|
|
248
250
|
case 'CATEGORIES':
|
|
249
|
-
event.
|
|
251
|
+
event.categories = value.split(',').map(c => c.trim());
|
|
252
|
+
event.category = event.categories[0];
|
|
250
253
|
break;
|
|
251
254
|
|
|
252
255
|
case 'STATUS': {
|
|
@@ -110,7 +110,7 @@ export class TimezoneManager {
|
|
|
110
110
|
timezone = this.database.resolveAlias(timezone);
|
|
111
111
|
|
|
112
112
|
// Check cache first
|
|
113
|
-
const cacheKey = `${timezone}_${date.getFullYear()}_${date.getMonth()}_${date.getDate()}`;
|
|
113
|
+
const cacheKey = `${timezone}_${date.getFullYear()}_${date.getMonth()}_${date.getDate()}_${date.getHours()}`;
|
|
114
114
|
if (this.offsetCache.has(cacheKey)) {
|
|
115
115
|
this.cacheHits++;
|
|
116
116
|
this._manageCacheSize();
|