The string-formatted date, as you appear to be generating, should work with
"JavaScript Literal" datatable.  Your datatable should look something like
this:

    var data = new google.visualization.DataTable(
   {
     cols: [{id: 'task', label: 'Employee Name', type: 'string'},
              {id: 'startDate', label: 'Start Date', type: 'datetime'}],
     rows: [{c:[{v: 'Mike'}, {v: "Date(2008, 1, 28)", f:'February 28,
2008'}]},
            {c:[{v: 'Bob'}, {v: new Date(2007, 5, 1)}]},
            {c:[{v: 'Alice'}, {v: new Date(2006, 7, 16)}]},
            {c:[{v: 'Frank'}, {v: new Date(2007, 11, 28)}]},
            {c:[{v: 'Floyd'}, {v: new Date(2005, 3, 13)}]},
            {c:[{v: 'Fritz'}, {v: new Date(2011, 6, 1)}]}
           ]
   }
);

Notice the 'cols' and 'rows' properties.  I specified the type of the
second column to be 'datetime', and used one string-formatted value:
"Date(2008, 1, 28)"

This string-formatted date representation is not guaranteed to work in
other cases since it is not otherwise needed.  You should just use new
Date(...) instead.   Hope that helps.  If not, can you provide a pointer to
your page that demostrates the error?

On Sun, Sep 7, 2014 at 10:41 AM, Ya'ir Eli <[email protected]> wrote:

> Hi,
>
> I'm fatching datetimes from SQL server via ASP.NET, and passing JSON with
> an ajax POST.
> Parsed the datetime strings based on your Datasource Protocol Spec
> <https://developers.google.com/chart/interactive/docs/dev/implementing_data_source?hl=pt-BR#jsondatatable>
> (C#)
> String.Format("Date({0:yyyy, MM, dd})", dr[2])
> +
> String.Format("{0:yyyy, MM, dd}", dr[2])
> (wasn't sure about it)
>
> Both ways returned a type mismatch.
> "Type mismatch. Value Date(2014, 01, 10) does not match type datetime in
> column index 0"
>
>
> Sorry for being stupid, can you help out?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to
> [email protected].
> Visit this group at
> http://groups.google.com/group/google-visualization-api.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>  -
978-394-1058
[email protected] <[email protected]>   5CC, Cambridge MA
[email protected] <[email protected]> 9 Juniper Ridge
Road, Acton MA

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to