feat: Formulaire de création RF sur une seule pag

This commit is contained in:
N3WT DE COMPET
2025-05-05 20:57:51 +02:00
parent 2a6b3bdf63
commit 76f9a7dd14
19 changed files with 1299 additions and 422 deletions

View File

@ -99,3 +99,45 @@ export const isWeekend = (date) => {
const day = date.getDay();
return day === 0 || day === 6;
};
/**
* Retourne l'année scolaire en cours au format "YYYY-YYYY".
* Exemple : Si nous sommes en octobre 2023, retourne "2023-2024".
*/
export function getCurrentSchoolYear() {
const now = new Date();
const currentYear = now.getFullYear();
const currentMonth = now.getMonth() + 1; // Les mois sont indexés à partir de 0
// Si nous sommes avant septembre, l'année scolaire a commencé l'année précédente
const startYear = currentMonth >= 9 ? currentYear : currentYear - 1;
return `${startYear}-${startYear + 1}`;
}
/**
* Retourne l'année scolaire suivante au format "YYYY-YYYY".
* Exemple : Si nous sommes en octobre 2023, retourne "2024-2025".
*/
export function getNextSchoolYear() {
const currentSchoolYear = getCurrentSchoolYear();
const [startYear, endYear] = currentSchoolYear.split('-').map(Number);
return `${startYear + 1}-${endYear + 1}`;
}
/**
* Retourne un tableau des années scolaires passées au format "YYYY-YYYY".
* Exemple : ["2022-2023", "2021-2022", "2020-2021"].
* @param {number} count - Le nombre d'années scolaires passées à inclure.
*/
export function getHistoricalYears(count = 5) {
const currentSchoolYear = getCurrentSchoolYear();
const [startYear] = currentSchoolYear.split('-').map(Number);
const historicalYears = [];
for (let i = 1; i <= count; i++) {
const historicalStartYear = startYear - i;
historicalYears.push(`${historicalStartYear}-${historicalStartYear + 1}`);
}
return historicalYears;
}

View File

@ -68,6 +68,7 @@ export const FE_ADMIN_HOME_URL = `/admin`;
// ADMIN/SUBSCRIPTIONS URL
export const FE_ADMIN_SUBSCRIPTIONS_URL = `/admin/subscriptions`;
export const FE_ADMIN_SUBSCRIPTIONS_CREATE_URL = `/admin/subscriptions/createSubscription`;
export const FE_ADMIN_SUBSCRIPTIONS_EDIT_URL = `/admin/subscriptions/editInscription`;
export const FE_ADMIN_SUBSCRIPTIONS_VALIDATE_URL = `/admin/subscriptions/validateSubscription`;

View File

@ -0,0 +1,16 @@
export const levels = [
{ value: '1', label: 'TPS - Très Petite Section' },
{ value: '2', label: 'PS - Petite Section' },
{ value: '3', label: 'MS - Moyenne Section' },
{ value: '4', label: 'GS - Grande Section' },
{ value: '5', label: 'CP' },
{ value: '6', label: 'CE1' },
{ value: '7', label: 'CE2' },
{ value: '8', label: 'CM1' },
{ value: '9', label: 'CM2' },
];
export const genders = [
{ value: '1', label: 'Garçon' },
{ value: '2', label: 'Fille' },
];