Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get dates between two moment objects
enumerateDaysBetweenDates = (startDate, endDate) => {
const now = startDate.clone().startOf("day");
const dates = [];
while (now.isSameOrBefore(endDate.startOf("day"))) {
dates.push(now.format("YYYY-MM-DD"));
now.add(1, "days");
}
return dates;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.