nodebb-plugin-equipment-calendar 8.9.2 → 8.9.3
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/library.js
CHANGED
|
@@ -1329,14 +1329,24 @@ async function handleCreateReservation(req, res) {
|
|
|
1329
1329
|
if (!itemIds.length) return res.status(400).send('itemIds required');
|
|
1330
1330
|
|
|
1331
1331
|
// Dates expected as YYYY-MM-DD (end inclusive in UI)
|
|
1332
|
-
const startIso = String(req.body.start || req.body.startDate || req.body.startIso || '').trim();
|
|
1333
|
-
const endIso = String(req.body.end || req.body.endDate || req.body.endIso || '').trim();
|
|
1334
|
-
|
|
1332
|
+
const startIso = String(req.body.start || req.body.startDate || req.body.startIso || req.body.startStr || '').trim().slice(0,10);
|
|
1333
|
+
const endIso = String(req.body.end || req.body.endDate || req.body.endIso || req.body.endStr || '').trim().slice(0,10);
|
|
1334
|
+
let _startIso = startIso;
|
|
1335
|
+
let _endIso = endIso;
|
|
1336
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(_startIso)) {
|
|
1337
|
+
const ms = Number(req.body.startMs || req.body.startTime || 0);
|
|
1338
|
+
if (ms) _startIso = new Date(ms).toISOString().slice(0,10);
|
|
1339
|
+
}
|
|
1340
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(_endIso)) {
|
|
1341
|
+
const ms = Number(req.body.endMs || req.body.endTime || 0);
|
|
1342
|
+
if (ms) _endIso = new Date(ms).toISOString().slice(0,10);
|
|
1343
|
+
}
|
|
1344
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(_startIso) || !/^\d{4}-\d{2}-\d{2}$/.test(_endIso)) {
|
|
1335
1345
|
return res.status(400).send('dates required');
|
|
1336
1346
|
}
|
|
1337
1347
|
|
|
1338
|
-
const startMs = Date.parse(
|
|
1339
|
-
const endMs = Date.parse(addDaysIso(
|
|
1348
|
+
const startMs = Date.parse(_startIso + 'T00:00:00Z');
|
|
1349
|
+
const endMs = Date.parse(addDaysIso(__endIso: _endIso, 1) + 'T00:00:00Z'); // exclusive end
|
|
1340
1350
|
if (!startMs || !endMs || endMs <= startMs) {
|
|
1341
1351
|
return res.status(400).send('dates required');
|
|
1342
1352
|
}
|
|
@@ -1364,8 +1374,8 @@ async function handleCreateReservation(req, res) {
|
|
|
1364
1374
|
itemId,
|
|
1365
1375
|
startMs,
|
|
1366
1376
|
endMs,
|
|
1367
|
-
|
|
1368
|
-
|
|
1377
|
+
_startIso: _startIso,
|
|
1378
|
+
_endIso: _endIso,
|
|
1369
1379
|
days,
|
|
1370
1380
|
unitPrice,
|
|
1371
1381
|
total,
|
package/package.json
CHANGED
package/plugin.json
CHANGED
package/public/js/client.js
CHANGED
|
@@ -139,34 +139,7 @@ function updateTotalPrice() {
|
|
|
139
139
|
selectMirror: true,
|
|
140
140
|
dayMaxEventRows: true,
|
|
141
141
|
displayEventTime: false,
|
|
142
|
-
|
|
143
|
-
eventContent: function(arg) {
|
|
144
|
-
try {
|
|
145
|
-
var status = (arg.event.extendedProps && arg.event.extendedProps.status) ? arg.event.extendedProps.status : '';
|
|
146
|
-
var iconClass = '';
|
|
147
|
-
if (status === 'pending') iconClass = 'fa fa-hourglass-half text-warning';
|
|
148
|
-
else if (status === 'paid') iconClass = 'fa fa-check-circle text-success';
|
|
149
|
-
else if (status === 'approved') iconClass = 'fa fa-check text-success';
|
|
150
|
-
else if (status === 'rejected' || status === 'cancelled') iconClass = 'fa fa-times text-danger';
|
|
151
|
-
|
|
152
|
-
var wrap = document.createElement('div');
|
|
153
|
-
wrap.className = 'ec-event';
|
|
154
|
-
if (iconClass) {
|
|
155
|
-
var icon = document.createElement('span');
|
|
156
|
-
icon.className = 'ec-icon';
|
|
157
|
-
icon.innerHTML = '<i class="' + iconClass + '"></i>';
|
|
158
|
-
wrap.appendChild(icon);
|
|
159
|
-
}
|
|
160
|
-
var t = document.createElement('span');
|
|
161
|
-
t.className = 'ec-title';
|
|
162
|
-
t.textContent = arg.event.title || '';
|
|
163
|
-
wrap.appendChild(t);
|
|
164
|
-
return { domNodes: [wrap] };
|
|
165
|
-
} catch (e) {
|
|
166
|
-
return true;
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
timeZone: 'local',
|
|
142
|
+
timeZone: 'local',
|
|
170
143
|
events: events,
|
|
171
144
|
select: function (info) {
|
|
172
145
|
if (!window.EC_CAN_CREATE) return;
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
</form>
|
|
37
37
|
|
|
38
38
|
<div class="text-muted small mb-2">
|
|
39
|
-
Total (filtré) : <strong>{total}</strong>
|
|
39
|
+
Total (filtré) : <strong>{total}</strong> - Total (global) : <strong>{totalAll}</strong>
|
|
40
40
|
</div>
|
|
41
41
|
|
|
42
42
|
{{{ if hasRows }}}
|