Try using new Date(2011,2,31...)

I seem to recall that the months are zero-indexed, so 3,31 would be
April 31st (or May 1st, seeing as how there are only 30 days in
April).

On Apr 4, 11:37 am, svaha <[email protected]> wrote:
> I'm having trouble with the datetime module.
>
> Everything seems to be working fine, all the datapoints show at the
> right times, but the date is listed as May 1st instead of March 31.
>
> function drawChart() {
>                 var data = new google.visualization.DataTable();
>                 data.addColumn('datetime', 'Date');
>                 data.addColumn('number', 'Temperature');
>                 data.addRows([ [new Date(2011,3,31,17,1,0,0),66.6] #
> lots of other dates listed in this format
>                  ]);
>                 var chart = new
> google.visualization.AnnotatedTimeLine(document.getElementById('chart_div') );
>                 chart.draw(data, {displayAnnotations: true});
>               }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to