DHTMLScheduler - remember the view

Can you give an example of how I might make it so that the scheduler would remember the date-range and view (week-month-day) that the user was last on if they browse away and back



I am using PHP and want to use session or cookies I guess, cookies would be best I think. I think I have the view working but it always show a view centered around today and not whatever date they were on when they left.



thanks

Current version has not ready to use extension for such use-case.
You can use events of scheduler to save the state to cookie.

>> var myDate=new Date(sugar_calendar_date)
most probably it must be
var myDate = Date.parse(sugar_calendar_date);

or, to not relay on built in parser you can create a date-to-string and string-to-date converters, and use them during saving/loading of current date


I found that the code below seems to work, I have to add default code for when the cookie doesn’t exist still but that should be easy.  I was just making it harder than it actually was.

var sugar_calendar_date = Get_Cookie(‘sugar_calendar_date’);
var sugar_calendar_view = Get_Cookie(‘sugar_calendar_view’);
var myDate=new Date(sugar_calendar_date)

scheduler.init(‘scheduler_here’,myDate,sugar_calendar_view);

and

scheduler.attachEvent(“onViewChange”, function (mode , date){
   Set_Cookie(‘sugar_calendar_view’,mode,30,’/’,’’,’’);
   Set_Cookie(‘sugar_calendar_date’,date,30,’/’,’’,’’);
});

I am currently working up the proof of concept to use this tool and buy a license and I must say that this is the best support I have ever gotten from anywhere.  Every answer is honest and examples are given when needed.  Great tool and great support, keep up the good work.