first commit with existing project files
This commit is contained in:
41
GestionnaireTaches.js
Normal file
41
GestionnaireTaches.js
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user