first commit with existing project files

This commit is contained in:
Vincent Guillet
2025-07-12 11:20:23 +02:00
commit d90d85d002
7 changed files with 316 additions and 0 deletions

41
GestionnaireTaches.js Normal file
View File

@@ -0,0 +1,41 @@
export class GestionnaireTaches {
constructor() {
this.taches = [];
}
ajouterTache(tache) {
this.taches.push(tache);
}
supprimerTache(tache) {
const index = this.taches.indexOf(tache);
if (index !== -1) {
this.taches.splice(index, 1);
} else {
console.error("Tâche non trouvée");
}
}
filtrerParMots(chaine) {
if (!chaine) return this.taches;
return this.taches.filter(tache =>
tache.contientMot(chaine));
}
filtrerParDate(dateDebut, dateFin) {
return this.taches.filter(tache =>
tache.estEntreDates(dateDebut, dateFin));
}
afficherToutes() {
this.taches.forEach(tache =>
tache.afficher()
);
}
compterTaches(taches) {
return taches.length;
}
}