First want to thank you for this great extension. It’s simple and very intuitive to use
I have few questions tho:
Is it possible to get the date streamed from the server side. Now the date is pulled localy from users computer - if i change my pc date it will also change current date calendar’s date on website.
I want to insert holidays in the calendar - is there a way i can limit start the end year? Example: from 2012 - 2030.
Searched everywhere, but i can’t seem to find that piece of code.
All i found in dhtmlxscheduler.js similar was:
dt = dt.getFullYear()-5; for (var i=0; i < 10; i++)html+="<option value='"+(dt+i)+"'>"+(dt+i)+"</option>";
that was at least kinda similar to the one you pasted
I pasted the code in scheduler_include.html, copied on the server and it still pull’s the local time (from user). Also i tried with enabling scheduler.config.server_utc = true; in scheduler config file and doesnt work.
I searched for the code you pasted in dhtmlxscheduler.js, but it’s not there.
The code i searched:
Thanks for help, but it’s just not working = i’m cursed
I guess i didn’t clarify the exact issue. I wanted for calendar to take current date from the server because when i change the clock on my pc to 12. march, then refresh the calendar on the site and hit “Today” button, it will go to 12. march. It would be great if the calendar stays on actual current date that is 30. april and not change it according to local date settings of user.
I changed the code:
dt = dt.getFullYear()-5; for (var i=0; i < 10; i++)html+="<option value='"+(dt+i)+"'>"+(dt+i)+"</option>";
Thanks radyno for help
The solution for no.2 (limit start/end year view) was to open scheduler_include.html and include:
<script>
scheduler.attachEvent("onBeforeViewChange", function (old_mode, old_date, mode , date){
var mind = new Date("January 1, 2012 00:00:00");
if (date.valueOf() < mind.valueOf()) return false;
var maxd = new Date("December 31, 2030 00:00:00");
if (date.valueOf() > maxd.valueOf()) return false;
return true;
});
</script>
If i find some way for no.1 (server time), i’ll post it here.
Hi there, I’m also trying to do something similar. I am creating a 2015 calendar in Year view. I want my calendar to start from 1st January 2015 instead of today’s date which is default. I tried using your code, but it didn’t work. Do you have any ideas how I can make this work?
Thank you!
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan