import chalk from 'chalk';
import {
addDays,
- addMonths,
addSeconds,
addWeeks,
- endOfMonth,
endOfWeek,
isAfter,
isBefore,
isTomorrow,
isYesterday,
- startOfMonth,
startOfWeek,
subDays,
- subMonths,
subWeeks,
} from 'date-fns';
subWeeks(chargingSchedule.startSchedule, 1);
}
break;
- case RecurrencyKindType.MONTHLY:
- if (isBefore(chargingSchedule.startSchedule, startOfMonth(currentDate))) {
- addMonths(chargingSchedule.startSchedule, 1);
- } else if (isAfter(chargingSchedule.startSchedule, endOfMonth(currentDate))) {
- subMonths(chargingSchedule.startSchedule, 1);
- }
- break;
}
}
// Check if the charging profile is active