Convert to javascript date in chat xAxis

Hi,

From server i recived this date format /Date(12365498455000)/. in a chart i make group by Day, in combo onchage event , but when is grouped by Day show in xAxi “/Date(46464656546000)/” and i need convert /Date(46464656546000)/ to human format, but after grouped because i need show correct format of date and sort by asc or desc.

Please check this snippet code

https://snippet.webix.com/9r4snggc

Thansk in advance

Hello @jorge,

i need convert /Date(46464656546000)/ to human format

Please take a look at the following example for a possible way of converting the value into a readable format: Code Snippet.

Basically, we need to create a date object in order to format it the way we want. The fastest way to do so with your initial data would be to convert the string with the timestamp into a timestamp (via a Data Scheme), which can be then used to create a date object. After we have our date object, we can use the webix.Date.dateToStr() method to format our data into a custom time format string.

One of the other ways to solve this issue includes converting the value received from the server, at least to the point where we can work with an actual data object. For example, you could return a timestamp and format it later on the client.

Thanks so much!!!