RELEASE V5.5.0 : Voici les modifications apportées :
-> Implémentation des afficheurs "Sécurité"; "Informations" et "Correspondances" pour les afficheurs AFL FONCTIONNALITÉS EN COURS DE DÉVELOPPEMENT : -> REFONTE DU DESIGN DES AFFICHEURS CLASSIQUES
This commit is contained in:
1 parent
1c83953552
commit
4f3a34b101
24 files changed
+3517
-412
No files matched your search
@@ -650,7 +650,7 @@ export default function ClassiquesArrivees(){
|
||||
}
|
||||
};
|
||||
});
|
||||
setHoraires(formatted.slice(0, defilementMode ? 20 : 10));
|
||||
setHoraires(formatted);
|
||||
setAllHoraires(formatted);
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -839,30 +839,54 @@ export default function ClassiquesArrivees(){
|
||||
const tomorrowStr = localDateStr(tomorrow);
|
||||
|
||||
const circulatesOn = (h, d) => {
|
||||
if (!h || !d) return false;
|
||||
const pad = (n) => String(n).padStart(2, '0');
|
||||
const targetDateStr = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
||||
const targetDateHyphen = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
||||
const targetDateCompact = `${d.getFullYear()}${pad(d.getMonth() + 1)}${pad(d.getDate())}`;
|
||||
const targetDay = d.getDay();
|
||||
|
||||
if (Array.isArray(h.dates) && h.dates.length > 0) {
|
||||
return h.dates.includes(targetDateCompact) || h.dates.includes(targetDateHyphen);
|
||||
}
|
||||
|
||||
const customDaysRaw = h.jours_personnalises;
|
||||
if (!customDaysRaw) return false;
|
||||
|
||||
let customDays = [];
|
||||
if (Array.isArray(customDaysRaw)) {
|
||||
customDays = customDaysRaw;
|
||||
} else if (typeof customDaysRaw === 'string') {
|
||||
try {
|
||||
customDays = JSON.parse(customDaysRaw);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
if (customDaysRaw) {
|
||||
let customDays = [];
|
||||
if (Array.isArray(customDaysRaw)) {
|
||||
customDays = customDaysRaw;
|
||||
} else if (typeof customDaysRaw === 'string') {
|
||||
try { customDays = JSON.parse(customDaysRaw); } catch (e) {}
|
||||
}
|
||||
if (Array.isArray(customDays) && customDays.length > 0) {
|
||||
const match = customDays.find(item => item.date === targetDateHyphen || item.date === targetDateCompact);
|
||||
if (match) return Boolean(match.circule);
|
||||
}
|
||||
}
|
||||
|
||||
if (Array.isArray(customDays)) {
|
||||
const match = customDays.find(item => item.date === targetDateStr);
|
||||
if (match) {
|
||||
return Boolean(match.circule);
|
||||
}
|
||||
const dayNames = ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'];
|
||||
const colName = `circule_${dayNames[targetDay]}`;
|
||||
if (typeof h[colName] !== 'undefined' && h[colName] !== null) {
|
||||
const db = h.date_debut ? String(h.date_debut).slice(0, 10) : null;
|
||||
const df = h.date_fin ? String(h.date_fin).slice(0, 10) : null;
|
||||
if (db && targetDateHyphen < db) return false;
|
||||
if (df && targetDateHyphen > df) return false;
|
||||
return Boolean(h[colName]);
|
||||
}
|
||||
return false;
|
||||
|
||||
if (Array.isArray(h.days) && h.days.length > 0) {
|
||||
if (!h.days.includes(targetDay)) return false;
|
||||
if (h.start && targetDateCompact < String(h.start).replace(/-/g, '')) return false;
|
||||
if (h.end && targetDateCompact > String(h.end).replace(/-/g, '')) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
const singleDate = h.date_depart || h.date || h.service_date;
|
||||
if (singleDate) {
|
||||
const sStr = String(singleDate).slice(0, 10);
|
||||
return sStr === targetDateHyphen || sStr.replace(/-/g, '') === targetDateCompact;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
// Construire listes pour aujourd'hui et demain en tenant compte des colonnes circule_*
|
||||
@@ -990,6 +1014,10 @@ export default function ClassiquesArrivees(){
|
||||
let serviceDateStr;
|
||||
if (todayCandidates && todayCandidates.length > 0) {
|
||||
finalList = todayCandidates.slice().sort((a,b)=> (a._arrHM||99999)-(b._arrHM||99999));
|
||||
if (finalList.length <= 5 && tomorrowCandidates && tomorrowCandidates.length > 0) {
|
||||
const sortedTomorrow = tomorrowCandidates.slice().sort((a,b)=> (a._arrHM||99999)-(b._arrHM||99999));
|
||||
finalList = [...finalList, ...sortedTomorrow];
|
||||
}
|
||||
serviceDateStr = todayStr;
|
||||
} else {
|
||||
finalList = (tomorrowCandidates || []).slice().sort((a,b)=> (a._arrHM||99999)-(b._arrHM||99999));
|
||||
|
||||
Reference in new issue
Block a user