sending JSON dates to google charts API from Perl

前端 未结 3 1961
一生所求
一生所求 2021-01-12 02:59

I have a small dancer application which serves up some HTML (including the javascript to call the google charts API) and for other URLs queries a database and returns the da

3条回答
  •  孤街浪徒
    2021-01-12 03:30

    JSON does not support datetime as a data types. But according to Google's documentation, you can just send a string with this format:

    JSON does not support JavaScript Date values (for example, "new Date(2008,1,28,0,31,26)"; the API implementation does. However, the API does now support a custom valid JSON representation of dates as a string in the following format: Date(year, month, day[,hour, minute, second[, millisecond]]) where everything after day is optional, and months are zero-based.

    Google Chart Tools Datasource Protocol

提交回复
热议问题