nodebb-plugin-onekite-calendar 1.0.13 → 1.0.14

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/lib/widgets.js CHANGED
@@ -169,9 +169,7 @@ widgets.renderTwoWeeksWidget = async function (data) {
169
169
  height: 'auto',
170
170
  headerToolbar: {
171
171
  left: 'prev,next',
172
- // No range/title in the widget: it becomes redundant and, when the
173
- // view crosses months, FullCalendar displays a start/end range.
174
- center: '',
172
+ center: 'title',
175
173
  right: '',
176
174
  },
177
175
  navLinks: false,
@@ -188,6 +186,16 @@ widgets.renderTwoWeeksWidget = async function (data) {
188
186
  return { html: '<span class="fc-daygrid-day-number">' + String(arg.dayNumberText || '') + '</span>' };
189
187
  }
190
188
  },
189
+ // Ensure day numbers never include month text (e.g. '1 janvier')
190
+ dayCellDidMount: function(arg) {
191
+ try {
192
+ const el = arg && arg.el ? arg.el.querySelector('.fc-daygrid-day-number') : null;
193
+ if (!el) return;
194
+ const t = String(el.textContent || '');
195
+ const m = t.match(/^\s*(\d+)/);
196
+ if (m) el.textContent = m[1];
197
+ } catch (e) {}
198
+ },
191
199
  eventClassNames: function(arg) {
192
200
  try {
193
201
  const ev = arg && arg.event;
@@ -281,14 +289,8 @@ dateClick: function() { window.location.href = calUrl; },
281
289
  return map[k] || '';
282
290
  });
283
291
  const status = (String(ep.type || '') === 'reservation') ? statusLabel(ep.status) : '';
284
- const start = ev.start ? new Date(ev.start) : null;
285
- const end = ev.end ? new Date(ev.end) : null;
286
- const pad2 = (n) => String(n).padStart(2, '0');
287
- const fmt = (d) => d ? (pad2(d.getDate()) + '/' + pad2(d.getMonth() + 1) + '/' + String(d.getFullYear()).slice(-2)) : '';
288
- const range = (start && end) ? ('Du ' + fmt(start) + ' au ' + fmt(end)) : '';
289
292
  const html = '' +
290
293
  '<div style="font-weight:600; margin-bottom:2px;">' + escapeHtml(title) + '</div>' +
291
- (range ? ('<div style="opacity:.85">' + escapeHtml(range) + '</div>') : '') +
292
294
  (status ? ('<div style="opacity:.75; margin-top:2px; font-size:.85em;">' + escapeHtml(status) + '</div>') : '');
293
295
 
294
296
  // Hover (desktop)
@@ -422,4 +424,4 @@ dateClick: function() { window.location.href = calUrl; },
422
424
  return data;
423
425
  };
424
426
 
425
- module.exports = widgets;
427
+ module.exports = widgets;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-onekite-calendar",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
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": "1.0.13"
42
+ "version": "1.0.14"
43
43
  }