@forcecalendar/interface 1.0.51 → 1.0.52

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forcecalendar/interface",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "type": "module",
5
5
  "description": "Official interface layer for forceCalendar Core - Enterprise calendar components",
6
6
  "main": "dist/force-calendar-interface.umd.js",
@@ -18,6 +18,7 @@ export class BaseViewRenderer {
18
18
  this.stateManager = stateManager;
19
19
  this._listeners = [];
20
20
  this._scrolled = false;
21
+ this._nowIndicatorTimer = null;
21
22
  }
22
23
 
23
24
  /**
@@ -36,6 +37,10 @@ export class BaseViewRenderer {
36
37
  element.removeEventListener(event, handler);
37
38
  });
38
39
  this._listeners = [];
40
+ if (this._nowIndicatorTimer) {
41
+ clearInterval(this._nowIndicatorTimer);
42
+ this._nowIndicatorTimer = null;
43
+ }
39
44
  }
40
45
 
41
46
  /**
@@ -137,6 +142,23 @@ export class BaseViewRenderer {
137
142
  return `<div class="fc-now-indicator" style="position: absolute; left: 0; right: 0; top: ${minutes}px; height: 2px; background: var(--fc-danger-color); z-index: 15; pointer-events: none;"></div>`;
138
143
  }
139
144
 
145
+ /**
146
+ * Start a timer that updates the now indicator position every 60 seconds.
147
+ * Call this after render() in day/week views that show a now indicator.
148
+ */
149
+ startNowIndicatorTimer() {
150
+ if (this._nowIndicatorTimer) {
151
+ clearInterval(this._nowIndicatorTimer);
152
+ }
153
+ this._nowIndicatorTimer = setInterval(() => {
154
+ const indicator = this.container.querySelector('.fc-now-indicator');
155
+ if (indicator) {
156
+ const now = new Date();
157
+ indicator.style.top = `${now.getHours() * 60 + now.getMinutes()}px`;
158
+ }
159
+ }, 60000);
160
+ }
161
+
140
162
  /**
141
163
  * Compute overlap layout columns for a list of timed events.
142
164
  * Returns a Map of event.id -> { column, totalColumns }.
@@ -31,6 +31,7 @@ export class DayViewRenderer extends BaseViewRenderer {
31
31
  this.container.innerHTML = html;
32
32
  this._attachEventHandlers();
33
33
  this._scrollToCurrentTime();
34
+ this.startNowIndicatorTimer();
34
35
  }
35
36
 
36
37
  _renderDayView(viewData, _config) {
@@ -31,6 +31,7 @@ export class WeekViewRenderer extends BaseViewRenderer {
31
31
  this.container.innerHTML = html;
32
32
  this._attachEventHandlers();
33
33
  this._scrollToCurrentTime();
34
+ this.startNowIndicatorTimer();
34
35
  }
35
36
 
36
37
  _renderWeekView(viewData, _config) {