You can get the number of days in a specified month (ok)

https://stackoverflow.com/questions/13146418/find-all-the-days-in-a-month-with-date-object

const getAllDaysInMonth = (month, year) => Array.from({
					length: new Date(year, month, 0).getDate()
				},
				(_, i) => new Date(year, month - 1, i + 1));
			const allDatesInOctober = getAllDaysInMonth(3, 2022)
			console.log(allDatesInOctober.map(x => x.toLocaleDateString([], { month: "numeric", day: "numeric" })))

Last updated

Navigation

Lionel

@Copyright 2023