This simple script is derived from jszen’s blog. While he has done lots of great work, you will see my script has no use with double for loops. This greatly improves the speed at which this script can execute and simplifies the algorithm substantially. Also, I added the ability to scroll through the months, NBD.
Executing Code
Below you’ll fine the required markup once the Library has been imported appropriately.
<div id="myCalendar"></div>
<script type="text/javascript">
window.onload = function() {
cal('myCalendar', /* month */, /* year */);
};
</script>
Javascript Library
Below you’ll find the source that is used to drive this calendar.
Edit 2020-11-14 - Reworked to use FETCH api and removed directly embedded source files
Edit 2021-06-27 - Moved to site CSS, and Embedded JS (yolo)