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
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
Answer posted by Dan Letecky [DayPilot] 7 years ago.
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