Simple and elegant solution:
const date = new Date(`${year}-${month}-${day} 00:00`)
const isValidDate = (Boolean(+date) && date.getDate() == day)
sources:
[1] https://medium.com/@esganzerla/simple-date-validation-with-javascript-caea0f71883c
Simple and elegant solution:
const date = new Date(`${year}-${month}-${day} 00:00`)
const isValidDate = (Boolean(+date) && date.getDate() == day)
sources:
[1] https://medium.com/@esganzerla/simple-date-validation-with-javascript-caea0f71883c