DEV Community 👩‍💻👨‍💻

Discussion on: How to Create a Simple React Calendar with Styled Component

Collapse
johndoe999 profile image
John Doe

Hey great article, helpful.

Suggest a small correction instead of :

const days = isLeapYear ? DAYS_LEAP : DAYS;

it should be :
const days = isLeapYear(date.getFullYear()) ? DAYS_LEAP : DAYS;

isLeapYear never gets called.

Cheers,
Salil

Collapse
zhiyueyi profile image
Zhiyue Yi Author

Yes, you are right! Thank you so much for pointing it out! :D