Ajuster rapports et heures des reunions
This commit is contained in:
parent
4adf65a8f5
commit
086bdbd548
4 changed files with 44 additions and 7 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { heureIsoSansFuseau } from '../../utils/datesReunion';
|
||||||
|
|
||||||
export function textePvAuto(pvPrecedent, propositions, resolutionsJour, postesVacants) {
|
export function textePvAuto(pvPrecedent, propositions, resolutionsJour, postesVacants) {
|
||||||
return [
|
return [
|
||||||
"Ouverture de l'assemblée.",
|
"Ouverture de l'assemblée.",
|
||||||
|
|
@ -25,5 +27,5 @@ export function moisPrecedent(dateStr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function heure(dateIso) {
|
export function heure(dateIso) {
|
||||||
return dateIso ? new Date(dateIso).toLocaleTimeString('fr-CA', { hour: '2-digit', minute: '2-digit' }) : '--:--';
|
return heureIsoSansFuseau(dateIso);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -363,8 +363,10 @@ export default function AssembleeAffaires({ contexte = false }) {
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
<button onClick={() => telechargerRapport(r)} disabled={loading}
|
<button onClick={() => telechargerRapport(r)} disabled={loading}
|
||||||
className="shrink-0 rounded-xl bg-gray-900 px-3 py-2 text-xs font-bold text-white disabled:opacity-40 print:hidden">
|
className="tap-target shrink-0 rounded-xl bg-indigo-50 p-3 text-indigo-700 ring-1 ring-indigo-100 active:scale-[0.96] disabled:opacity-40 print:hidden"
|
||||||
Rapport PDF
|
aria-label="Télécharger le rapport PDF"
|
||||||
|
title="Rapport PDF">
|
||||||
|
<ReportIcon />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -509,3 +511,15 @@ export default function AssembleeAffaires({ contexte = false }) {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ReportIcon() {
|
||||||
|
return (
|
||||||
|
<svg aria-hidden="true" viewBox="0 0 24 24" className="h-5 w-5" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
|
||||||
|
<path d="M7 3h7l4 4v14H7z" />
|
||||||
|
<path d="M14 3v5h4" />
|
||||||
|
<path d="M10 12h5" />
|
||||||
|
<path d="M10 16h5" />
|
||||||
|
<path d="M10 8h1" />
|
||||||
|
</svg>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
||||||
import { api } from '../stores/api';
|
import { api } from '../stores/api';
|
||||||
import { useStore } from '../stores/store';
|
import { useStore } from '../stores/store';
|
||||||
import PageHeader from '../components/PageHeader';
|
import PageHeader from '../components/PageHeader';
|
||||||
import { dateHeureReunionIso, datesReunion, dateLocale, labelDateReunion } from '../utils/datesReunion';
|
import { dateHeureReunionIso, datesReunion, dateLocale, heureIsoSansFuseau, labelDateReunion } from '../utils/datesReunion';
|
||||||
|
|
||||||
const TYPES_JETONS = [['desir', 'Désir'], ['24h', '24 heures'], ['1mois', '1 mois'], ['2mois', '2 mois'], ['3mois', '3 mois'], ['6mois', '6 mois'], ['9mois', '9 mois'], ['1an', '1 an'], ['multiple', 'Multiple']];
|
const TYPES_JETONS = [['desir', 'Désir'], ['24h', '24 heures'], ['1mois', '1 mois'], ['2mois', '2 mois'], ['3mois', '3 mois'], ['6mois', '6 mois'], ['9mois', '9 mois'], ['1an', '1 an'], ['multiple', 'Multiple']];
|
||||||
const INPUT = 'w-full p-3 bg-gray-50 rounded-xl border-0 focus:ring-2 focus:ring-aa-blue';
|
const INPUT = 'w-full p-3 bg-gray-50 rounded-xl border-0 focus:ring-2 focus:ring-aa-blue';
|
||||||
|
|
@ -234,7 +234,7 @@ export default function ReunionHebdomadaire({ contexte = false }) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const heure = (dateIso) => (dateIso ? new Date(dateIso).toLocaleTimeString('fr-CA', { hour: '2-digit', minute: '2-digit' }) : '—');
|
const heure = (dateIso) => heureIsoSansFuseau(dateIso);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-gray-100">
|
<div className="min-h-screen bg-gray-100">
|
||||||
|
|
@ -274,8 +274,10 @@ export default function ReunionHebdomadaire({ contexte = false }) {
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
<button onClick={() => telechargerRapport(r)} disabled={loading}
|
<button onClick={() => telechargerRapport(r)} disabled={loading}
|
||||||
className="shrink-0 rounded-xl bg-gray-900 px-3 py-2 text-xs font-bold text-white disabled:opacity-40">
|
className="tap-target shrink-0 rounded-xl bg-blue-50 p-3 text-aa-blue ring-1 ring-blue-100 active:scale-[0.96] disabled:opacity-40"
|
||||||
Rapport PDF
|
aria-label="Télécharger le rapport PDF"
|
||||||
|
title="Rapport PDF">
|
||||||
|
<ReportIcon />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -356,6 +358,18 @@ export default function ReunionHebdomadaire({ contexte = false }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ReportIcon() {
|
||||||
|
return (
|
||||||
|
<svg aria-hidden="true" viewBox="0 0 24 24" className="h-5 w-5" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round">
|
||||||
|
<path d="M7 3h7l4 4v14H7z" />
|
||||||
|
<path d="M14 3v5h4" />
|
||||||
|
<path d="M10 12h5" />
|
||||||
|
<path d="M10 16h5" />
|
||||||
|
<path d="M10 8h1" />
|
||||||
|
</svg>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function Resume({ rencontre }) {
|
function Resume({ rencontre }) {
|
||||||
return (
|
return (
|
||||||
<div className="text-sm text-gray-600 space-y-1">
|
<div className="text-sm text-gray-600 space-y-1">
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,13 @@ export function dateHeureReunionIso(dateStr, groupe) {
|
||||||
return `${dateStr}T${heureReunion(groupe)}:00`;
|
return `${dateStr}T${heureReunion(groupe)}:00`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function heureIsoSansFuseau(dateIso) {
|
||||||
|
if (!dateIso) return '--:--';
|
||||||
|
const match = String(dateIso).match(/T(\d{2}:\d{2})/);
|
||||||
|
if (match) return match[1];
|
||||||
|
return '--:--';
|
||||||
|
}
|
||||||
|
|
||||||
export function indexJourReunion(groupe) {
|
export function indexJourReunion(groupe) {
|
||||||
if (!groupe?.jour_reunion) return null;
|
if (!groupe?.jour_reunion) return null;
|
||||||
const jour = JOURS_SEMAINE[groupe.jour_reunion.toLowerCase()];
|
const jour = JOURS_SEMAINE[groupe.jour_reunion.toLowerCase()];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue