nodebb-plugin-onekite-calendar 2.0.7 → 2.0.9
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 +6 -0
- package/lib/api.js +16 -2
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/public/client.js +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog – calendar-onekite
|
|
2
2
|
|
|
3
|
+
## 1.2.16
|
|
4
|
+
- Modale réservation (Durée rapide) : correction du grisé erroné des matériels réservés la veille. Les requêtes de disponibilité utilisent désormais des dates calendaires (YYYY-MM-DD) au lieu de toISOString() (UTC), pour éviter tout faux chevauchement lié au fuseau/DST.
|
|
5
|
+
|
|
6
|
+
## 1.2.15
|
|
7
|
+
- Réservations (Durée rapide) : génération des évènements all-day basée sur startDate/endDate (YYYY-MM-DD) quand disponibles, pour éviter tout décalage lié à toISOString() (UTC) et empêcher un grisé « non disponible » le jour suivant.
|
|
8
|
+
|
|
3
9
|
## 1.2.14
|
|
4
10
|
- 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
11
|
|
package/lib/api.js
CHANGED
|
@@ -356,8 +356,22 @@ function eventsFor(resv) {
|
|
|
356
356
|
const status = resv.status;
|
|
357
357
|
const icons = { pending: '⏳', awaiting_payment: '💳', paid: '✅' };
|
|
358
358
|
const colors = { pending: '#f39c12', awaiting_payment: '#d35400', paid: '#27ae60' };
|
|
359
|
-
|
|
360
|
-
|
|
359
|
+
// IMPORTANT:
|
|
360
|
+
// Prefer stored date-only strings when available.
|
|
361
|
+
//
|
|
362
|
+
// Rationale: when reservations are stored as local-midnight timestamps (because
|
|
363
|
+
// the client sends YYYY-MM-DD), converting those timestamps with toISOString()
|
|
364
|
+
// shifts the date in Europe/Paris (UTC+1/+2) and can make ranges appear to
|
|
365
|
+
// overlap the following day in some UI flows (notably "Durée rapide").
|
|
366
|
+
//
|
|
367
|
+
// FullCalendar expects `end` to be EXCLUSIVE for all-day ranges, so we keep
|
|
368
|
+
// using the stored endDate as-is.
|
|
369
|
+
const startIsoDate = (resv.startDate && /^\d{4}-\d{2}-\d{2}$/.test(String(resv.startDate)))
|
|
370
|
+
? String(resv.startDate)
|
|
371
|
+
: new Date(parseInt(resv.start, 10)).toISOString().slice(0, 10);
|
|
372
|
+
const endIsoDate = (resv.endDate && /^\d{4}-\d{2}-\d{2}$/.test(String(resv.endDate)))
|
|
373
|
+
? String(resv.endDate)
|
|
374
|
+
: new Date(parseInt(resv.end, 10)).toISOString().slice(0, 10);
|
|
361
375
|
|
|
362
376
|
const itemIds = Array.isArray(resv.itemIds) ? resv.itemIds : (resv.itemId ? [resv.itemId] : []);
|
|
363
377
|
const itemNames = Array.isArray(resv.itemNames) ? resv.itemNames : (resv.itemName ? [resv.itemName] : []);
|
package/package.json
CHANGED
package/plugin.json
CHANGED
package/public/client.js
CHANGED
|
@@ -960,9 +960,16 @@ function toDatetimeLocalValue(date) {
|
|
|
960
960
|
|
|
961
961
|
function rangeQuery(s, e) {
|
|
962
962
|
try {
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
963
|
+
// IMPORTANT: For availability checks we must avoid ISO strings with timezone
|
|
964
|
+
// (e.g. toISOString()) because local midnight in Europe/Paris becomes
|
|
965
|
+
// 23:00Z or 22:00Z depending on DST, which makes consecutive all-day ranges
|
|
966
|
+
// appear to overlap and wrongly greys out items.
|
|
967
|
+
//
|
|
968
|
+
// We always query using *calendar dates* (YYYY-MM-DD) with end exclusive,
|
|
969
|
+
// matching FullCalendar's all-day rule.
|
|
970
|
+
const sYmd = toLocalYmd(s);
|
|
971
|
+
const eYmd = toLocalYmd(e);
|
|
972
|
+
return new URLSearchParams({ start: sYmd, end: eYmd }).toString();
|
|
966
973
|
} catch (err) {
|
|
967
974
|
return '';
|
|
968
975
|
}
|