trananhtuat / js-calendar

Calendar UI Design with Dark Mode and Animation Using HTML CSS JavaScript
79 stars 51 forks source link

generateCalendar function is not working for January #1

Open tokumaci opened 3 years ago

tokumaci commented 3 years ago

Because of arrays start from zero and zero number returns false in if condition generateCalendar function can not work for first month January. If you disable if (!month) month condition, calender will work also for january.

image

manishjha5410 commented 3 years ago

Yes

InadullaevMakhmudjon commented 3 years ago

Because of arrays start from zero and zero number returns false in if condition generateCalendar function can not work for first month January. If you disable if (!month) month condition, calender will work also for january.

image

Just replace 23rd line: if (!month && month != '0') month = currDate.getMonth()

prasadsawant7 commented 2 years ago

if (!month && month !== 0) month = currDate.getMonth()

Add this issue will be solved for January month

manishjha5410 commented 2 years ago

Yes