Having date and time in timeline charts not working properly

29 views
Skip to first unread message

Muthukumar Subramanian

unread,
Nov 14, 2017, 9:21:38 PM11/14/17
to Google Visualization API
In the timeline chart, if i use time alone with the 0,0,0 as date and well within 24 hrs ,it working fine. If i cross the 24hrs boundary by giving the time as 48,0,0, etc. or providing the date along with time like 2017,11,14,12,0,0. Then the date goes wrong and also the time shows as 1 day as min and not showing hrs: min . Am i missing something ?
This is the code i was using it.

       
dataTable.addColumn({ type: 'string', id: 'Resource' });
dataTable
.addColumn({ type: 'string', id: 'Name' });
dataTable
.addColumn({ type: 'date', id: 'Start' });
dataTable
.addColumn({ type: 'date', id: 'End' });
dataTable
.addRows([
[ 'resource1',      'job1', new Date(2017,11,13,13,45,0),  new Date(2017,11,13,23,0,0) ],
[ 'resource1',      'job2', new Date(2017,11,14,13,45,0),  new Date(2017,11,14,23,0,0) ],
[ 'resource2',  'job3', new Date(2017,11,19,12,0,0),  new Date(2017,11,19,15,20,0) ]]);

This is what i get for the above. Date is wrong and also Duration shows as 1 day instead of some 9hrs 15mins


Reply all
Reply to author
Forward
0 new messages