Answers for "Validate a gregorian date"

0

Validate a gregorian date

// `m`: the month (zero-based index)
// `d`: the day
// `y`: the year
const isValidDate = (m, d, y) => 0 <= m && m <= 11 && 0 < y && y < 32768 && 0 < d && d <= (new Date(y, m, 0)).getDate();
Posted by: Guest on October-21-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language