@forcecalendar/core 2.1.48 → 2.1.50

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/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';
@@ -179,6 +179,14 @@ export class TimezoneManager {
179
179
  * @returns {boolean} True if in DST
180
180
  */
181
181
  isDST(date, timezone, dstRule = null) {
182
+ // Check cache first
183
+ const cacheKey = `${timezone}_${date.getFullYear()}_${date.getMonth()}_${date.getDate()}_${date.getHours()}`;
184
+ if (this.dstCache.has(cacheKey)) {
185
+ this.cacheHits++;
186
+ return this.dstCache.get(cacheKey);
187
+ }
188
+ this.cacheMisses++;
189
+
182
190
  // Get DST rule if not provided
183
191
  if (!dstRule) {
184
192
  const tzData = this.database.getTimezone(timezone);
@@ -201,11 +209,18 @@ export class TimezoneManager {
201
209
  );
202
210
 
203
211
  // Handle Southern Hemisphere (DST crosses year boundary)
212
+ let result;
204
213
  if (dstStart > dstEnd) {
205
- return date >= dstStart || date < dstEnd;
214
+ result = date >= dstStart || date < dstEnd;
215
+ } else {
216
+ result = date >= dstStart && date < dstEnd;
206
217
  }
207
218
 
208
- return date >= dstStart && date < dstEnd;
219
+ // Cache the result
220
+ this.dstCache.set(cacheKey, result);
221
+ this._manageCacheSize();
222
+
223
+ return result;
209
224
  }
210
225
 
211
226
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forcecalendar/core",
3
- "version": "2.1.48",
3
+ "version": "2.1.50",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "A modern, lightweight, framework-agnostic calendar engine optimized for Salesforce",