change the display option

219 views
Skip to first unread message

netdjw

unread,
Apr 18, 2016, 4:13:15 AM4/18/16
to jquery week calendar
Hi there,

I have this code:

$('#calendar').weekCalendar({
        displayOddEven:true,
        timeslotsPerHour : 4,
        allowCalEventOverlap : true,
        use24Hour: true,
        firstDayOfWeek : 1,
        daysToShow : 1,
        switchDisplay: {'daily': 1, 'weekly': 7},
        [...]
});

Now it's everyting is working fine. I want to create my own buttons to step to the prev/next day or week - based on display view. I found the .nextWeek() function, but didn't find the .nextDay() function.

How can I step to the next day?

Peter Pivarc

unread,
May 25, 2016, 9:05:02 AM5/25/16
to jquery week calendar
Have you tried 
$('#calendar').weekCalendar("gotoWeek", new Date(year, month, day, 0, 0, 0));


You can even hook it to jquery ui datepicker like
$(your datepicker).datepicker({dateFormat: "dd.mm.yy",
onSelect: function(newDate){
var year = newDate.split('.')[2];
var month = newDate.split('.')[1]-1;
var day = newDate.split('.')[0];
$('#calendar').weekCalendar("gotoWeek", new Date(year, month, day, 0, 0, 0));
}
});


Reply all
Reply to author
Forward
0 new messages