Impossible Date

Published by Matt in

Given the parameters day, month and year, return whether that date is a valid date.

Examples

isValidDate(35, 2, 2020) ➞ false
// February doesn't have 35 days.

isValidDate(8, 3, 2020) ➞ true
// 8th March 2020 is a real date.

isValidDate(31, 6, 1980) ➞ false
// June only has 30 days.

Notes

N/A

Watch a quick demo on how Edabit works.