search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

timeline assign date

Asked by Otto
3 years ago.

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( );
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

Comment posted by Anonymous
3 years ago.

I think I found a solution.
var plustage = 180;

loadTimeline( plustage ) );


Comment posted by Anonymous
3 years ago.

Now I can change the start day from 2 comboboxes.
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( plusdays ) );
Best regards

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

See also:

Another helpful method:

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.