@event-calendar/build 5.6.1 → 5.7.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/README.md CHANGED
@@ -136,6 +136,7 @@ Inspired by [FullCalendar](https://fullcalendar.io/), it implements similar opti
136
136
  - [slotWidth](#slotwidth)
137
137
  - [snapDuration](#snapduration)
138
138
  - [theme](#theme)
139
+ - [timeZone](#timezone)
139
140
  - [titleFormat](#titleformat)
140
141
  - [unselect](#unselect)
141
142
  - [unselectAuto](#unselectauto)
@@ -260,8 +261,8 @@ This bundle contains a version of the calendar that includes all plugins and is
260
261
 
261
262
  The first step is to include the following lines of code in the `<head>` section of your page:
262
263
  ```html
263
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.6.1/dist/event-calendar.min.css">
264
- <script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.6.1/dist/event-calendar.min.js"></script>
264
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.7.0/dist/event-calendar.min.css">
265
+ <script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.7.0/dist/event-calendar.min.js"></script>
265
266
  ```
266
267
 
267
268
  <details>
@@ -1652,6 +1653,15 @@ Start date of the range the calendar needs events for
1652
1653
  End date of the range the calendar needs events for
1653
1654
  </td>
1654
1655
  </tr>
1656
+ <tr>
1657
+ <td>
1658
+
1659
+ `timeZone`
1660
+ </td>
1661
+ <td>
1662
+ The value of the calendar's [timeZone](#timezone) option. Sent only when `timeZone` is not `'local'`
1663
+ </td>
1664
+ </tr>
1655
1665
  </table>
1656
1666
  </td>
1657
1667
  </tr>
@@ -1721,6 +1731,13 @@ function(fetchInfo, successCallback, failureCallback) { }
1721
1731
  </td>
1722
1732
  <td>ISO8601 string representation of the end date</td>
1723
1733
  </tr>
1734
+ <tr>
1735
+ <td>
1736
+
1737
+ `timeZone`
1738
+ </td>
1739
+ <td>The value of the calendar's [timeZone](#timezone) option</td>
1740
+ </tr>
1724
1741
  </table>
1725
1742
 
1726
1743
  The `successCallback` function must be called by the custom function with an array of [parsable](#parsing-event-from-a-plain-object) [Event](#event-object) objects.
@@ -2640,6 +2657,39 @@ function (theme) {
2640
2657
  </tr>
2641
2658
  </table>
2642
2659
 
2660
+ ### timeZone
2661
+ - Type `string`
2662
+ - Default `'local'`
2663
+
2664
+ The time zone the calendar uses to display dates and times.
2665
+
2666
+ The following values are accepted:
2667
+ - `'local'` — uses the browser's local time zone
2668
+ - `'UTC'` — uses UTC (zero offset)
2669
+ - A UTC offset string in the form `'±HH:MM'`, e.g. `'+05:30'` or `'-06:00'`
2670
+
2671
+ Event dates that contain an explicit timezone offset in their ISO string (e.g. `'2028-06-01T10:00:00+02:00'`) will be shifted to the calendar's timezone. Event dates without timezone info (e.g. `'2028-06-01T10:00:00'`) are treated as floating — they display their wall-clock time as-is and will be interpreted in the calendar's timezone from that point forward.
2672
+
2673
+ When the `timeZone` option changes at runtime, all already-loaded events and the current `date` option are automatically shifted to the new timezone. Events from [eventSources](#eventsources) are re-fetched automatically.
2674
+
2675
+ ```js
2676
+ let ec = new EventCalendar(document.getElementById('ec'), {
2677
+ timeZone: '+02:00',
2678
+ events: [
2679
+ {
2680
+ start: '2028-06-01T10:00:00', // floating — displayed as 10:00
2681
+ end: '2028-06-01T12:00:00',
2682
+ title: 'Meeting'
2683
+ },
2684
+ {
2685
+ start: '2028-06-01T10:00:00+00:00', // UTC — displayed as 12:00 in +02:00
2686
+ end: '2028-06-01T12:00:00+00:00',
2687
+ title: 'Call'
2688
+ }
2689
+ ]
2690
+ });
2691
+ ```
2692
+
2643
2693
  ### titleFormat
2644
2694
  - Type `object` or `function`
2645
2695
  - Default `{year: 'numeric', month: 'short', day: 'numeric'}`
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * EventCalendar v5.6.1
2
+ * EventCalendar v5.7.0
3
3
  * https://github.com/vkurko/calendar
4
4
  */
5
5
  .ec{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--ec-color-400:oklch(70.8% 0 0);--ec-color-300:oklch(87% 0 0);--ec-color-200:oklch(92.2% 0 0);--ec-color-100:oklch(97% 0 0);--ec-color-50:oklch(98.5% 0 0);--ec-bg-color:#fff;--ec-text-color:currentcolor;--ec-border-color:var(--ec-color-300);--ec-button-bg-color:var(--ec-bg-color);--ec-button-border-color:var(--ec-border-color);--ec-button-text-color:var(--ec-text-color);--ec-button-active-bg-color:var(--ec-color-200);--ec-button-active-border-color:var(--ec-color-400);--ec-button-active-text-color:var(--ec-button-text-color);--ec-today-bg-color:oklch(98.7% .026 102.212);--ec-highlight-color:oklch(98.4% .019 200.873);--ec-event-bg-color:oklch(70.7% .165 254.624);--ec-event-text-color:#fff;--ec-bg-event-color:var(--ec-color-300);--ec-bg-event-opacity:.3;--ec-event-col-gap:.375rem;--ec-now-indicator-color:oklch(63.7% .237 25.331);--ec-popup-bg-color:var(--ec-bg-color)}.ec-dark .ec{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--ec-color-400:oklch(43.9% 0 0);--ec-color-300:oklch(37.1% 0 0);--ec-color-200:oklch(26.9% 0 0);--ec-color-100:oklch(20.5% 0 0);--ec-color-50:oklch(14.5% 0 0);--ec-bg-color:var(--ec-color-100);--ec-today-bg-color:oklch(28.6% .066 53.813);--ec-highlight-color:oklch(30.2% .056 229.695);--ec-bg-event-opacity:.5}@media (prefers-color-scheme:dark){.ec-auto-dark .ec{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--ec-color-400:oklch(43.9% 0 0);--ec-color-300:oklch(37.1% 0 0);--ec-color-200:oklch(26.9% 0 0);--ec-color-100:oklch(20.5% 0 0);--ec-color-50:oklch(14.5% 0 0);--ec-bg-color:var(--ec-color-100);--ec-today-bg-color:oklch(28.6% .066 53.813);--ec-highlight-color:oklch(30.2% .056 229.695);--ec-bg-event-opacity:.5}}.ec-day{--ec-day-bg-color:var(--ec-bg-color);background-color:var(--ec-day-bg-color);border:1px solid var(--ec-border-color);border-block-start:none;border-inline-start:none}.ec-day.ec-today{--ec-day-bg-color:var(--ec-today-bg-color)}.ec-day.ec-highlight{--ec-day-bg-color:var(--ec-highlight-color)}.ec-time-grid .ec-body .ec-day{background-image:linear-gradient(to top, var(--ec-day-bg-color) 1px, transparent 1px), linear-gradient(to top, var(--ec-border-color) 1px, transparent 1px), linear-gradient(to right, var(--ec-day-bg-color) 1px, transparent 1px), linear-gradient(to top, var(--ec-border-color) 1px, transparent 1px);background-size:100% 100%, 100% calc(var(--ec-slot-height) * var(--ec-slot-label-periodicity)), 2px 100%, 100% var(--ec-slot-height)}.ec-timeline:not(.ec-month-view,.ec-year-view) .ec-body .ec-day{--ec-last-line-color:transparent;--ec-direction:to left}[dir=rtl] :is(.ec-timeline:not(.ec-month-view,.ec-year-view) .ec-body .ec-day){--ec-direction:to right}.ec-timeline:not(.ec-month-view,.ec-year-view) .ec-body .ec-day{background-image:linear-gradient(var(--ec-direction), var(--ec-last-line-color) 1px, transparent 1px), linear-gradient(var(--ec-direction), var(--ec-border-color) 1px, transparent 1px), linear-gradient(var(--ec-day-bg-color) 1px, transparent 1px), linear-gradient(var(--ec-direction), var(--ec-border-color) 1px, transparent 1px);background-size:100% 100%, calc(var(--ec-slot-width) * var(--ec-slot-label-periodicity)) 100%, 100% 2px, var(--ec-slot-width) 100%;border-inline:none}.ec-timeline:not(.ec-month-view,.ec-year-view) .ec-body .ec-day.ec-no-ieb{--ec-last-line-color:var(--ec-day-bg-color)}.ec-day-grid .ec-day{flex-direction:column;justify-content:space-between;min-block-size:5em;display:flex}.ec-day-grid .ec-uniform .ec-day{min-block-size:auto}.ec-list .ec-day{border-inline:none}.ec-list .ec-day:last-child{border:none}.ec-day.ec-no-ieb{border-inline-end:none}.ec-day.ec-no-beb{border-block-end:none}.ec-day-head{flex-direction:row-reverse;justify-content:space-between;display:flex}.ec-day-grid.ec-month-view .ec-day-head{padding:.375rem}.ec-day.ec-other-month .ec-day-head time{opacity:.3}.ec-list .ec-day-head{background-color:var(--ec-day-bg-color);border-block-end:1px solid var(--ec-border-color);flex-direction:unset;z-index:2;margin:0 0 -1px;padding:.5em 1.5em;position:sticky;inset-block-start:0}.ec-day-foot{padding:.18rem;font-size:.85em}.ec-day-foot a{cursor:pointer}.ec-disabled{position:relative}.ec-disabled:after{content:"";background-color:var(--ec-bg-event-color);opacity:var(--ec-bg-event-opacity);position:absolute;inset:0}.ec-toolbar{justify-content:space-between;align-items:center;margin-block-end:1em;display:flex}.ec-toolbar>*{flex-wrap:wrap;gap:.5rem .75rem;display:inline-flex}.ec-title{margin:0}.ec-button{background-color:var(--ec-button-bg-color);border:1px solid var(--ec-button-border-color);border-radius:.25rem;padding:.375rem .75rem;font-size:1rem;line-height:1.5}.ec-button:not(:disabled){color:var(--ec-button-text-color);cursor:pointer}.ec-button:not(:disabled):hover,.ec-button.ec-active{background-color:var(--ec-button-active-bg-color);border-color:var(--ec-button-active-border-color);color:var(--ec-button-active-text-color);z-index:1}.ec-button-group{vertical-align:top;display:inline-flex}.ec-button-group .ec-button:not(:first-child){border-start-start-radius:0;border-end-start-radius:0;margin-inline-start:-1px}.ec-button-group .ec-button:not(:last-child){border-start-end-radius:0;border-end-end-radius:0}.ec-icon{inline-size:1em;display:inline-block}.ec-icon.ec-prev:after,.ec-icon.ec-next:after{content:"";border-block-start:2px solid;border-inline-end:2px solid;block-size:.5em;inline-size:.5em;display:inline-block;position:relative}.ec-icon.ec-prev:after{inset-inline-start:3px;rotate:-135deg}[dir=rtl] .ec-icon.ec-prev:after{rotate:135deg}.ec-icon.ec-next:after{inset-inline-start:-3px;rotate:45deg}[dir=rtl] .ec-icon.ec-next:after{rotate:-45deg}.ec-sidebar{z-index:1;background-color:var(--ec-bg-color);border-inline-end:1px solid var(--ec-border-color);text-align:end;position:sticky;inset-inline-start:0;overflow:clip}.ec-header .ec-sidebar{border-block-end:1px solid var(--ec-border-color);padding-block:.375rem}.ec-time-grid .ec-sidebar{padding-inline:.75rem}.ec-time-grid .ec-body .ec-sidebar{--ec-direction:to left}[dir=rtl] :is(.ec-time-grid .ec-body .ec-sidebar){--ec-direction:to right}.ec-time-grid .ec-body .ec-sidebar{background-image:linear-gradient(var(--ec-direction), transparent .375rem, var(--ec-bg-color) .375rem), linear-gradient(to top, var(--ec-bg-color) 1px, transparent 1px), linear-gradient(to top, var(--ec-border-color) 1px, transparent 1px), linear-gradient(to right, var(--ec-bg-color) 1px, transparent 1px), linear-gradient(to top, var(--ec-border-color) 1px, transparent 1px);background-size:100% 100%, 100% 100%, 100% calc(var(--ec-slot-height) * var(--ec-slot-label-periodicity)), 2px 100%, 100% var(--ec-slot-height)}.ec-timeline .ec-body .ec-sidebar{grid-area:1/1/-1/2;grid-template-rows:subgrid;display:grid}.ec-row-head{border-block-end:1px solid var(--ec-border-color);min-block-size:1.5em;padding:.375em .75rem;display:flex}.ec-row-head:last-child{border:none}.ec-expander{inline-size:1.25em;margin-block-start:-1px;margin-inline-end:.25em}.ec-expander .ec-button{aspect-ratio:1;block-size:1.25em;padding:0;line-height:normal}.ec-slot{white-space:nowrap}.ec-time-grid .ec-slot{block-size:calc(var(--ec-slot-height) * var(--ec-slot-label-periodicity));position:relative;inset-block-start:-.5lh}.ec-timeline .ec-slot{grid-column:span var(--ec-slot-label-periodicity);text-overflow:ellipsis;padding:.18rem 0;font-size:.95em;overflow:clip}.ec-slots{grid-auto-flow:column;grid-auto-columns:var(--ec-slot-width);text-align:center;--ec-day-bg-color:var(--ec-bg-color);background-color:var(--ec-day-bg-color);border-block-end:1px solid var(--ec-border-color);display:grid}.ec-slots.ec-today{--ec-day-bg-color:var(--ec-today-bg-color)}.ec-slots.ec-highlight{--ec-day-bg-color:var(--ec-highlight-color)}.ec-slots{--ec-last-line-color:transparent;--ec-direction:to left}[dir=rtl] .ec-slots{--ec-direction:to right}.ec-slots{background-image:linear-gradient(var(--ec-direction), var(--ec-last-line-color) 1px, transparent 1px), linear-gradient(var(--ec-direction), var(--ec-border-color) 1px, transparent 1px);background-size:100% 100%, calc(var(--ec-slot-width) * var(--ec-slot-label-periodicity)) 100%}.ec-slots:last-child{--ec-last-line-color:var(--ec-day-bg-color)}.ec-events{grid-area:1/2/-1/-1;grid-template:subgrid / subgrid;isolation:isolate;pointer-events:none;display:grid}.ec-day-grid .ec-events{grid-column-start:1}.ec-event{color:var(--ec-event-text-color);box-sizing:border-box;box-shadow:0 0 1px 0 var(--ec-border-color);background-color:var(--ec-event-bg-color);z-index:1;pointer-events:all;inline-size:calc(100% - var(--ec-event-col-gap));border-radius:3px;padding:2px;font-size:.85em;line-height:1.5;display:flex;position:relative}.ec-time-grid .ec-event{grid-row:1}.ec-day-grid .ec-event,.ec-all-day .ec-event,.ec-timeline .ec-event{block-size:max-content;margin-block-end:var(--ec-event-col-gap)}.ec-list .ec-event{color:inherit;background-color:var(--ec-day-bg-color);border-radius:0;flex-direction:row;padding:.5em 1.5em}.ec-event.ec-preview{z-index:1000;-webkit-user-select:none;user-select:none;opacity:.8}.ec-event.ec-pointer{color:inherit;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:0;box-shadow:none}.ec-bg-event{background-color:var(--ec-bg-event-color);opacity:var(--ec-bg-event-opacity);grid-row:1;position:relative}.ec-draggable{cursor:pointer;-webkit-user-select:none;user-select:none}.ec-ghost{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none}.ec-event-body{flex-direction:column;inline-size:100%;display:flex}.ec-day-grid .ec-event-body,.ec-all-day .ec-event-body,.ec-timeline .ec-event-body{flex-direction:row}.ec-event-tag{border-radius:2px;inline-size:4px;margin-inline-end:8px}.ec-event-time{white-space:nowrap;flex-shrink:0;max-block-size:100%;margin:0 0 1px;overflow:hidden}.ec-day-grid .ec-event-time,.ec-timeline .ec-event-time{text-overflow:ellipsis;max-inline-size:100%;margin:0 3px 0 0}.ec-event-title{font-weight:inherit;margin:0;overflow:hidden}.ec-time-grid .ec-event-title{position:sticky;inset-block-start:var(--ec-header-height)}.ec-day-grid .ec-event-title,.ec-all-day .ec-event-title,.ec-timeline .ec-event-title{white-space:nowrap;text-overflow:ellipsis;min-block-size:1.5em;position:sticky;inset-inline-start:calc(var(--ec-sidebar-width) + .18em)}.ec-list .ec-event-title{font-size:1rem}.ec-resizer{-webkit-user-select:none;user-select:none;position:absolute}.ec-time-grid .ec-body .ec-resizer{cursor:ns-resize;block-size:50%;max-block-size:8px;inset:auto 0 0}.ec-time-grid .ec-body .ec-resizer.ec-start{inset:0 0 auto}.ec-day-grid .ec-resizer,.ec-all-day .ec-resizer,.ec-timeline .ec-resizer{cursor:ew-resize;inline-size:50%;max-inline-size:8px;inset:0 0 0 auto}:is(.ec-day-grid .ec-resizer,.ec-all-day .ec-resizer,.ec-timeline .ec-resizer).ec-start{inset:0 auto 0 0}.ec-dragging,.ec-dragging *{cursor:pointer!important}.ec-resizing-y,.ec-resizing-y *{cursor:ns-resize!important}.ec-resizing-x,.ec-resizing-x *{cursor:ew-resize!important}.ec-no-events{text-align:center;background-color:var(--ec-bg-color);padding:5em 0}.ec-now-indicator{pointer-events:none;will-change:inset;grid-row:2;position:relative}.ec-time-grid .ec-now-indicator{border-block-start:var(--ec-now-indicator-color) solid 2px;block-size:0;inline-size:100%}.ec-timeline .ec-now-indicator{border-inline-start:var(--ec-now-indicator-color) solid 2px;inline-size:0}.ec-timeline .ec-now-indicator:before{z-index:2;inset-block-start:calc(var(--ec-header-height) - 6.5px)}.ec-now-indicator:before{background:var(--ec-now-indicator-color);content:"";block-size:12px;inline-size:12px;z-index:1;border-radius:50%;margin-block-start:-7px;margin-inline-start:-7px;display:block;position:sticky;inset-inline-start:calc(var(--ec-sidebar-width) - 6.5px)}.ec-popup{box-sizing:border-box;background-color:var(--ec-popup-bg-color);border:1px solid var(--ec-border-color);block-size:max-content;min-block-size:8em;inline-size:125%;min-inline-size:12em;box-shadow:var(--ec-color-300) 0 10px 15px -3px, var(--ec-color-300) 0 4px 6px -4px;border-radius:.25rem;flex-direction:column;padding:.375rem .75rem .75rem;display:flex;position:relative}.ec-popup .ec-day-head{flex-direction:row;padding-inline:0}.ec-popup .ec-day-head a{cursor:pointer;font-size:1.5em;line-height:.8}.ec-popup .ec-events{--ec-event-col-gap:0;pointer-events:auto;display:block;overflow-y:auto}.ec-custom-scrollbars .ec-main::-webkit-scrollbar{background-color:#0000}.ec-custom-scrollbars .ec-main::-webkit-scrollbar-thumb{box-shadow:none;background-color:var(--ec-border-color);background-clip:padding-box;border:4px solid #0000;border-radius:8px}.ec-custom-scrollbars .ec-main::-webkit-scrollbar-thumb:hover{background-color:var(--ec-color-400)}.ec{flex-direction:column;display:flex}.ec-main{border:1px solid var(--ec-border-color);display:grid;overflow:auto}.ec-time-grid .ec-main{grid-template-columns:max-content repeat(var(--ec-grid-cols), var(--ec-col-width));grid-template-rows:repeat(2,max-content)}.ec-day-grid .ec-main{--ec-row-height:auto;grid-template-columns:repeat(var(--ec-grid-cols), minmax(0, 1fr));grid-template-rows:max-content repeat(var(--ec-grid-rows), var(--ec-row-height))}.ec-day-grid .ec-main.ec-uniform{--ec-row-height:minmax(0, 1fr);flex-grow:1;overflow:hidden}.ec-timeline .ec-main{grid-template-columns:max-content repeat(var(--ec-grid-cols), min-content);grid-template-rows:max-content var(--ec-grid-rows);flex-grow:1}.ec-timeline:is(.ec-month-view,.ec-year-view) .ec-main{grid-template-columns:max-content repeat(var(--ec-grid-cols), var(--ec-col-width))}.ec-header{grid-area:1/1/2/-1;grid-template-columns:subgrid;z-index:2;display:grid;position:sticky;inset-block-start:0}.ec-grid{grid-area:1/1/-1/-1;grid-template-columns:subgrid;display:grid}.ec-body .ec-grid{grid-template-rows:subgrid}.ec-time-grid .ec-grid,.ec-timeline .ec-grid{grid-column-start:2}.ec-all-day{grid-area:2/1/auto/-1;grid-template-columns:subgrid;min-block-size:var(--ec-slot-height);display:grid}.ec-col-group{grid-column:span var(--ec-col-group-span)}.ec-col-group,.ec-col-head{text-align:center;background-color:var(--ec-bg-color);border:1px solid var(--ec-border-color);text-overflow:ellipsis;border-block-start:none;border-inline-start:none;padding:.375rem .18em;overflow:clip}:is(.ec-col-group,.ec-col-head).ec-today{background-color:var(--ec-today-bg-color)}:is(.ec-col-group,.ec-col-head).ec-highlight{background-color:var(--ec-highlight-color)}.ec-col-group:nth-last-child(1 of .ec-col-group),.ec-col-head:nth-last-child(1 of .ec-col-head){border-inline-end:none}.ec-col-group>*,.ec-timeline .ec-col-head>*{position:sticky;inset-inline-start:calc(var(--ec-sidebar-width) + .18em)}.ec-body{grid-area:2/1/-1/-1;grid-template:subgrid / subgrid;display:grid}.ec-hidden{visibility:hidden}