in lib/utils/milestones.js [10:22]
export function getNextMilestone({
dayOfWeek = 4,
startDate = new Date(),
} = {}) {
if (startDate.getDay() === dayOfWeek) {
return startDate;
}
const resultDate = new Date(startDate.getTime());
resultDate.setDate(
startDate.getDate() + ((7 + dayOfWeek - startDate.getDay() - 1) % 7) + 1,
);
return resultDate;
}