feat: add end support for calc-schedule-budget
This commit is contained in:
@@ -41,16 +41,24 @@ for (const s of schedules) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const start = (typeof s._date === 'string' ? s._date : s._date.start).slice(0, 7);
|
const start = (typeof s._date === 'string' ? s._date : s._date.start).slice(0, 7);
|
||||||
// TODO: get end
|
|
||||||
if (start > month) {
|
if (start > month) {
|
||||||
console.log(chalk.grey(`- ${formatSchedule(s)}: not in range`));
|
console.log(chalk.grey(`- ${formatSchedule(s)}: not in range`));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (s.name === "Etails - Téléphone" || s.name === "FF14") {
|
||||||
|
console.log(s);
|
||||||
|
}
|
||||||
|
|
||||||
let date = start;
|
let date = start;
|
||||||
while (date < month) {
|
if (typeof s._date === 'object') {
|
||||||
|
let occurrences = 0;
|
||||||
|
while (date < month || occurrences < s._date.endOccurrences) {
|
||||||
|
occurrences += 1;
|
||||||
date = addFromFrequency(date, s._date.frequency, s._date.interval);
|
date = addFromFrequency(date, s._date.frequency, s._date.interval);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (date !== month) {
|
if (date !== month) {
|
||||||
console.log(chalk.grey(`- ${formatSchedule(s)}: not the specified month`));
|
console.log(chalk.grey(`- ${formatSchedule(s)}: not the specified month`));
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user