february showing 31 days when using next month button it works fine if manually changed

my javascript calendar works fine in some month but some doesnt especially february it becomes 31 days but if i change the date manually from pc it works fine here is my code https://codepen.io/Dennyyan/pen/KKrjWpR
Denny
CodePen
KKrjWpR
...
2 Replies
Wolle
Wolle17mo ago
Your code does not empty previously filled blocks. So changing to Feb only fills up to 28, but 29-31 are still filled from the month before, so they stay unchanged.
Yann2
Yann2OP17mo ago
ahh i see thank you ayy it solved thx a lot
Want results from more Discord servers?
Add your server