nodebb-plugin-onekite-calendar 2.0.5 → 2.0.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog – calendar-onekite
2
2
 
3
+ ## 1.2.14
4
+ - Réservations : correction d’un faux chevauchement (problème 1h) quand FullCalendar envoie des bornes all-day à minuit UTC (Z / +00:00) — le lendemain n’est plus marqué « non disponible ».
5
+
6
+ ## 1.2.13
7
+ - ACP (mode sombre) : correction de la visibilité de la liste d’autocomplete d’adresse (couleurs via variables Bootstrap)
8
+
3
9
  ## 1.2.12
4
10
  - Modales (calendrier + ACP) : autocomplete adresse rendu identique et compatible Bootstrap input-group (plus de wrapper qui casse l’affichage)
5
11
 
package/lib/api.js CHANGED
@@ -214,6 +214,20 @@ function toTs(v) {
214
214
  const s = String(v).trim();
215
215
  if (/^[0-9]+$/.test(s)) return parseInt(s, 10);
216
216
 
217
+ // IMPORTANT (all-day boundaries / FullCalendar):
218
+ // Depending on FullCalendar config (or how dates are built), all-day range
219
+ // boundaries can arrive as an ISO string at **midnight UTC** (Z or +00:00).
220
+ // Example: 2026-01-11T00:00:00.000Z
221
+ // In Europe/Paris this is 01:00 local, which makes consecutive all-day ranges
222
+ // appear to overlap by 1 hour and wrongly marks the next day as unavailable.
223
+ // When we detect a midnight-UTC boundary, we treat it as a calendar date and
224
+ // convert to **local midnight** for overlap computations.
225
+ const mUtcMidnight = /^((\d{4}-\d{2}-\d{2}))T00:00:00(?:\.\d{1,3})?(?:Z|\+00:00)$/.exec(s);
226
+ if (mUtcMidnight && mUtcMidnight[1]) {
227
+ const dLocal = new Date(mUtcMidnight[1] + 'T00:00:00');
228
+ return dLocal.getTime();
229
+ }
230
+
217
231
  // IMPORTANT: Date-only strings like "2026-01-09" are interpreted as UTC by JS Date(),
218
232
  // which can create 1h overlaps in Europe/Paris (and other TZs) between consecutive days.
219
233
  // We treat date-only inputs as local-midnight by appending a time component.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-onekite-calendar",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "FullCalendar-based equipment reservation workflow with admin approval & HelloAsso payment for NodeBB",
5
5
  "main": "library.js",
6
6
  "license": "MIT",
package/plugin.json CHANGED
@@ -39,5 +39,5 @@
39
39
  "acpScripts": [
40
40
  "public/admin.js"
41
41
  ],
42
- "version": "2.0.5"
42
+ "version": "2.0.7"
43
43
  }
package/public/admin.js CHANGED
@@ -2,6 +2,36 @@
2
2
  define('admin/plugins/calendar-onekite', ['alerts', 'bootbox'], function (alerts, bootbox) {
3
3
  'use strict';
4
4
 
5
+ // ACP dark mode compatibility: style the address autocomplete dropdown using
6
+ // Bootstrap CSS variables (so it remains readable in dark themes).
7
+ (function ensureOnekiteAdminStyles() {
8
+ try {
9
+ if (document.getElementById('onekite-acp-inline-styles')) return;
10
+ const style = document.createElement('style');
11
+ style.id = 'onekite-acp-inline-styles';
12
+ style.textContent = `
13
+ .onekite-autocomplete-menu {
14
+ background: var(--bs-body-bg, #fff);
15
+ color: var(--bs-body-color, #212529);
16
+ border: 1px solid var(--bs-border-color, rgba(0,0,0,.15));
17
+ box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
18
+ }
19
+ .onekite-autocomplete-item {
20
+ color: inherit;
21
+ background: transparent;
22
+ }
23
+ .onekite-autocomplete-item:hover,
24
+ .onekite-autocomplete-item:focus {
25
+ background: var(--bs-tertiary-bg, rgba(0,0,0,.05));
26
+ outline: none;
27
+ }
28
+ `;
29
+ document.head.appendChild(style);
30
+ } catch (e) {
31
+ // ignore
32
+ }
33
+ })();
34
+
5
35
  // Cache of pending reservations keyed by rid so delegated click handlers
6
36
  // can open rich modals without embedding large JSON blobs into the DOM.
7
37
  const pendingCache = new Map();
@@ -242,8 +272,7 @@ define('admin/plugins/calendar-onekite', ['alerts', 'bootbox'], function (alerts
242
272
  menu.style.right = '0';
243
273
  menu.style.top = '100%';
244
274
  menu.style.zIndex = '2000';
245
- menu.style.background = '#fff';
246
- menu.style.border = '1px solid rgba(0,0,0,.15)';
275
+ // Colors are handled via CSS variables (supports ACP dark mode).
247
276
  menu.style.borderTop = '0';
248
277
  menu.style.maxHeight = '220px';
249
278
  menu.style.overflowY = 'auto';
@@ -276,15 +305,12 @@ define('admin/plugins/calendar-onekite', ['alerts', 'bootbox'], function (alerts
276
305
  btn.style.textAlign = 'left';
277
306
  btn.style.padding = '.35rem .5rem';
278
307
  btn.style.border = '0';
279
- btn.style.background = 'transparent';
280
308
  btn.style.cursor = 'pointer';
281
309
  btn.addEventListener('click', () => {
282
310
  inputEl.value = h.displayName;
283
311
  hide();
284
312
  try { onPick && onPick(h); } catch (e) {}
285
313
  });
286
- btn.addEventListener('mouseenter', () => { btn.style.background = 'rgba(0,0,0,.05)'; });
287
- btn.addEventListener('mouseleave', () => { btn.style.background = 'transparent'; });
288
314
  menu.appendChild(btn);
289
315
  });
290
316
  menu.style.display = 'block';