Back to Type Challenges

README

questions/09155-hard-validdate/README.md

latest1.3 KB
Original Source
<!--info-header-start--><h1>ValidDate </h1><blockquote><p>by ch3cknull <a href="https://github.com/ch3cknull" target="_blank">@ch3cknull</a></p></blockquote><p><a href="https://tsch.js.org/9155/play" target="_blank"></a> </p><!--info-header-end-->

Implement a type ValidDate, which takes an input type T and returns whether T is a valid date.

Leap year is not considered

Good Luck!

ts
ValidDate<'0102'> // true
ValidDate<'0131'> // true
ValidDate<'1231'> // true
ValidDate<'0229'> // false
ValidDate<'0100'> // false
ValidDate<'0132'> // false
ValidDate<'1301'> // false
<!--info-footer-start-->

<a href="../../README.md" target="_blank"></a> <a href="https://tsch.js.org/9155/answer" target="_blank"></a> <a href="https://tsch.js.org/9155/solutions" target="_blank"></a> <!--info-footer-end-->