@forcecalendar/core 0.2.1 → 0.3.0
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/events/Event.js
CHANGED
|
@@ -178,10 +178,12 @@ export class Event {
|
|
|
178
178
|
organizer = null,
|
|
179
179
|
attendees = [],
|
|
180
180
|
reminders = [],
|
|
181
|
-
|
|
181
|
+
category, // Support singular category (no default)
|
|
182
|
+
categories, // Support plural categories (no default)
|
|
182
183
|
attachments = [],
|
|
183
184
|
conferenceData = null,
|
|
184
|
-
metadata = {}
|
|
185
|
+
metadata = {},
|
|
186
|
+
...rest // Capture any extra properties
|
|
185
187
|
}) {
|
|
186
188
|
// Normalize and validate input
|
|
187
189
|
const normalized = Event.normalize({
|
|
@@ -205,10 +207,12 @@ export class Event {
|
|
|
205
207
|
organizer,
|
|
206
208
|
attendees,
|
|
207
209
|
reminders,
|
|
208
|
-
|
|
210
|
+
category, // Pass category to normalize
|
|
211
|
+
categories, // Pass categories to normalize
|
|
209
212
|
attachments,
|
|
210
213
|
conferenceData,
|
|
211
|
-
metadata
|
|
214
|
+
metadata,
|
|
215
|
+
...rest // Pass any extra properties
|
|
212
216
|
});
|
|
213
217
|
|
|
214
218
|
// Validate normalized data
|
|
@@ -262,7 +266,7 @@ export class Event {
|
|
|
262
266
|
this.reminders = [...normalized.reminders];
|
|
263
267
|
|
|
264
268
|
// Categories/Tags
|
|
265
|
-
this.categories = [...normalized.categories];
|
|
269
|
+
this.categories = normalized.categories ? [...normalized.categories] : [];
|
|
266
270
|
|
|
267
271
|
// Attachments
|
|
268
272
|
this.attachments = [...normalized.attachments];
|
package/core/index.js
CHANGED
|
@@ -19,7 +19,7 @@ export { ICSHandler } from './ics/ICSHandler.js';
|
|
|
19
19
|
export { EventSearch } from './search/EventSearch.js';
|
|
20
20
|
|
|
21
21
|
// Version
|
|
22
|
-
export const VERSION = '0.
|
|
22
|
+
export const VERSION = '0.3.0';
|
|
23
23
|
|
|
24
24
|
// Default export
|
|
25
25
|
export { Calendar as default } from './calendar/Calendar.js';
|
|
@@ -295,8 +295,8 @@ export class TimezoneManager {
|
|
|
295
295
|
const offsetHours = -offset / 60;
|
|
296
296
|
|
|
297
297
|
// Try to match offset to known timezone
|
|
298
|
-
for (const [tz,
|
|
299
|
-
if (
|
|
298
|
+
for (const [tz, tzData] of Object.entries(this.database.timezones)) {
|
|
299
|
+
if (tzData.offset / 60 === offsetHours) {
|
|
300
300
|
return tz;
|
|
301
301
|
}
|
|
302
302
|
}
|
|
@@ -313,14 +313,14 @@ export class TimezoneManager {
|
|
|
313
313
|
if (!tzString) return 'UTC';
|
|
314
314
|
|
|
315
315
|
// Check if it's already an IANA identifier
|
|
316
|
-
if (this.
|
|
316
|
+
if (this.database.timezones.hasOwnProperty(tzString)) {
|
|
317
317
|
return tzString;
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
// Check abbreviations
|
|
321
321
|
const upperTz = tzString.toUpperCase();
|
|
322
|
-
if (this.
|
|
323
|
-
return this.
|
|
322
|
+
if (this.database.abbreviations && this.database.abbreviations.hasOwnProperty(upperTz)) {
|
|
323
|
+
return this.database.abbreviations[upperTz];
|
|
324
324
|
}
|
|
325
325
|
|
|
326
326
|
// Try to parse offset format (e.g., "+05:30", "-08:00")
|
|
@@ -332,8 +332,8 @@ export class TimezoneManager {
|
|
|
332
332
|
const totalOffset = sign * (hours + minutes / 60);
|
|
333
333
|
|
|
334
334
|
// Find matching timezone
|
|
335
|
-
for (const [tz,
|
|
336
|
-
if (offset === totalOffset) {
|
|
335
|
+
for (const [tz, tzData] of Object.entries(this.database.timezones)) {
|
|
336
|
+
if (tzData.offset / 60 === totalOffset) {
|
|
337
337
|
return tz;
|
|
338
338
|
}
|
|
339
339
|
}
|