econtrol-tools-calendar 1.0.10 → 1.0.11

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/dist/calendar.js CHANGED
@@ -200,11 +200,45 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
200
200
  const eventOrganizerId = ((_a = event.extendedProps) == null ? void 0 : _a.organizerId) || "";
201
201
  return eventOrganizerId === currentUserId.value;
202
202
  }
203
- const events = ref([...props.events]);
203
+ function normalizeEventTime(time) {
204
+ if (!time) return void 0;
205
+ if (time instanceof Date) {
206
+ return time;
207
+ }
208
+ if (typeof time === "number") {
209
+ return new Date(time);
210
+ }
211
+ if (typeof time === "string") {
212
+ if (time.includes("T")) {
213
+ return time;
214
+ }
215
+ const dateOnlyPattern = /^\d{4}-\d{2}-\d{2}$/;
216
+ if (dateOnlyPattern.test(time)) {
217
+ const normalizedTime = `${time} 00:00:00`;
218
+ return formatToISO(normalizedTime);
219
+ }
220
+ const dateTimePattern = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;
221
+ if (dateTimePattern.test(time)) {
222
+ return formatToISO(time);
223
+ }
224
+ return time;
225
+ }
226
+ return time;
227
+ }
228
+ function normalizeEvent(event) {
229
+ return {
230
+ ...event,
231
+ start: normalizeEventTime(event.start),
232
+ end: normalizeEventTime(event.end)
233
+ };
234
+ }
235
+ const events = ref(
236
+ (props.events || []).map((event) => normalizeEvent(event))
237
+ );
204
238
  watch(
205
239
  () => props.events,
206
240
  (newEvents) => {
207
- events.value = [...newEvents || []];
241
+ events.value = (newEvents || []).map((event) => normalizeEvent(event));
208
242
  },
209
243
  { deep: true, immediate: true }
210
244
  );
@@ -1474,6 +1508,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1474
1508
  "value-format": "YYYY-MM-DD HH:mm:ss",
1475
1509
  "disabled-date": disabledPastDate,
1476
1510
  key: `start-${formData.start || "empty"}`,
1511
+ "append-to-body": "",
1512
+ "z-index": 3001,
1477
1513
  style: { "width": "100%" }
1478
1514
  }, null, 8, ["modelValue"]))
1479
1515
  ]),
@@ -1490,6 +1526,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1490
1526
  "value-format": "YYYY-MM-DD HH:mm:ss",
1491
1527
  "disabled-date": disabledPastDate,
1492
1528
  key: `end-${formData.end || "empty"}`,
1529
+ "append-to-body": "",
1530
+ "z-index": 3001,
1493
1531
  style: { "width": "100%" }
1494
1532
  }, null, 8, ["modelValue"]))
1495
1533
  ]),
@@ -1621,7 +1659,7 @@ const _export_sfc = (sfc, props) => {
1621
1659
  }
1622
1660
  return target;
1623
1661
  };
1624
- const SCalendarComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7eba74c1"]]);
1662
+ const SCalendarComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c28885e3"]]);
1625
1663
  function getHolidays(year) {
1626
1664
  const holidays = {};
1627
1665
  if (year === 2026) {