Hello, I would like to have 2 comboboxes to select the start date. I tried to resolve the task with the session object. But I can’t find out how I can assigne the selected date to timeline. loadTimeline( DayPilot.Date.today() ); Can someone please help me. I tried to build a string like this: var $date = '2019-05-04 12:00:00' but I do not find out how to convert this tor loadTimeLine( $date ) Thanks in advance Otto
Hello, I think I found a solution. var plustage = 180;
loadTimeline( DayPilot.Date.today().addDays( plustage ) );
Regards Otto
Now I can change the start day from 2 comboboxes. <script> var cMonat =(<?php echo $select1; ?>); var cJahr = (<?php echo $select; ?>); var d = new Date( cJahr +"-" + cMonat + "-01"); var dd = new Date(); var g = d - dd ; var plusdays = Math.floor( g / (24*60*60*1000)); ... loadTimeline( DayPilot.Date.today().addDays( plusdays ) ); ... </script> Best regards Otto
Hi Otto,
You can create DayPilot.Date object from an ISO string using a constructor:
var date = new DayPilot.Date("2019-05-04T12:00:00"); // "2019-05-04 12:00:00" works as well
See also: https://api.daypilot.org/daypilot-date-constructor/
Another helpful method: https://api.daypilot.org/daypilot-date-fromyearmonthday/