Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set current month as default period #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Set current month as default period
While retrieving events for events list required to specify
month or day of month. While initializing current month of current year
should be specified.

Fixes issue #43.
dyod committed Jan 24, 2018
commit e0ba76e2fe107105c8889d20d87d44c2265ab0fd
8 changes: 7 additions & 1 deletion js/jquery.eventCalendar.js
Original file line number Diff line number Diff line change
@@ -271,7 +271,10 @@

function getEvents(flags, eventsOpts, limit, year, month, day, direction) {
limit = limit || 0;
year = year || '';

var today = new Date();

year = year || today.getFullYear();
day = day || '';

// to avoid problem with january (month = 0)
@@ -281,6 +284,9 @@
} else {
month = '';
}
if (!month) {
month = today.getMonth();
}

//var month = month || '';
flags.wrap.find('.eventCalendar-loading').fadeIn();