Share your repls and programming experiences

← Back to all posts
JS Calendar Generator
tussiez (1654)

Have you ever needed to create a calendar for your blog/website/app but never wanted to spend the time to write one? Gathering information such as the start day and end day of a specific month is time-consuming. That's why I wrote this basic calendar generator to automatically create an accurate HTML calendar for you.
Just include <script src=""></script>in your page and use generateCalendar('element-id') with element-id as your div element. For extra flexibility, I have left out table styling so you can customize it for your own page.
Do you want to set a custom date? Use customcalendar.js instead of calendar.js and add a Date object after your element ID.
It would look like this: generateCalendar('ele-id',new Date(..)). The application might still have a glitch with February, so please let me know in the comments if it is still there. Most of the information in this post is also on the homepage of the repl here: