meow meow - 1 year ago 98
Javascript Question

how to make calendar not to redirect on current month

this is a

script, I am using

I have one problem, here I have used a username filter, and when I am on January and then select a name from the dropdown filter, then it automatically redirects me to the current month. Then every time I have to click the Previous arrow.

How to solve this problem if I am currently on July month and select a username, so that it selects the name but doesn't redirect to current month.

Please help.

Below is my script's code:


$(document).ready(function() {

height: 350,
contentHeight: 300,
aspectRatio: 2,
eventLimit: 6,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay,listMonth'
defaultDate: '<?=date("Y-m-d")?>',
navLinks: false, // can click day/week names to navigate views
businessHours: false, // display business hours
editable: false,
eventLimit: true,
events: [ // my data coming here with foreach loop
start: '',
overlap: false,

color: ,





A little help will really be appreciated.

K48 K48
Answer Source

When you switch to another user, you should also remember the current month or time in some way. Depending on your page, it can be in a cookie, in a JS variable, etc.

Then you can switch to your previously selected date as follows:

//for testing; in real case you need to load this from somewhere
var previousDate = moment("2016-01"); 

$('#calendar').fullCalendar('gotoDate', previousDate);

You will place this at the end of your code that does the switching from one user or another, or in the viewRender.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download