Calendar Library

This library is meant to supply all basic calendar functionality. It finds both fixed and moveable holidays and allows users to jump between months and even years.
A calendar can be created by simply writing the following code in your main.js

let calendar = new Calendar(2017, 1);
calendar.printMonth();

And a div with the id of "calendarMonth" into your index.html
Buttons for moving between months can be added by using the following code

calendar.printPrevNext();

window.prevBtn = function() {
calendar.prevMonth();
}

window.nextBtn = function() {
calendar.nextMonth();
}

And a div in your HTML with the id "buttonInfo".
To add the ability for users to input the year and month they want to jump to, add the following code. You can also notice that this works with the buttons, so when you click to a next month, the input value will update here as well.

calendar.userInput();

window.setDate = function() {
let yearInp = document.getElementById("yearInput").value;
let monthInp = document.getElementById("monthInput").value;
calendar.clearMonth();
calendar = new Calendar(yearInp, monthInp);
calendar.printMonth();
}

And a div in your html with the id "inputInfo".
In order to add today's current date, add the following code

calendar.printDate();

And a div in your HTML with the id "calendarDay".
To print a certain week of a month, do the following code. The 3 represents the third week of that month and the 1 the month.

calendar.printWeek(3, 1);

And a div in your HTML with the id "calendarWeek"
You can also have the entire calendar year print out by adding this code

calendar.printCalendar();

And a div in your HTML with the id "fullCalendar".

Other Methods

Additional methods are as follows

calendar.clearMonth();
Used to get rid of a past month in case you'd like to generate a new one

calendar.nextMonth(); and calendar.prevMonth();
These are used to loop through other months as well as change values inside of the user input boxes.

A Library by Sophie Wargo