Création de tableaux d'entiers

ajout d'une méthode propre pour construire un tableau d'entiers
consécutifs
This commit is contained in:
2023-03-08 02:00:38 +01:00
parent 5fd3a43b2a
commit 42ed5da2d4
4 changed files with 18 additions and 14 deletions

View File

@ -190,12 +190,8 @@ export class RdDCalendrier extends Application {
/* -------------------------------------------- */
getJoursSuivants(count) {
let jours = [];
let indexDate = this.timestamp.indexDate;
for (let i = 0; i < count; i++, indexDate++) {
jours[i] = { label: RdDTimestamp.formatIndexDate(indexDate), index: indexDate };
}
return jours;
return Misc.intArray(this.timestamp.indexDate, this.timestamp.indexDate + count)
.map(i => { return { label: RdDTimestamp.formatIndexDate(i), index: i } })
}
/* -------------------------------------------- */