PDA

View Full Version : Chart with Dates struggles



jbender11
1 May 2017, 9:49 AM
I'm using Architect 4.1.2 and Ext-js 6.2 to generate a 3D-Chart with dates on the x-axis. I'm seeing this JSON coming back from the server:

data: [3]
0: Object
date: "2017-05-01"
amt: 20
1: Object
date: "2017-05-01"
ratePlan: 8
2:Object
date: "2017-05-01"
avail: 32

I am plotting amt, ratePlan and avail on the y-axis and date on the x-axis.
The problem is that the chart is displaying the date as April 30, 2017 and not May 1 2017. I've seen others people post about this same problem and it looks like the code is converting a GMT date/time to local date/time (I'm in the Central Time Zone). I have yet to find a solution to this however. I've tried using the dateFormat field of my store model to be 'Y-m-d', but that actually made things worse.

Any suggestions? I've thought of changing my model to use a String instead of a Date but that doesn't seem right.

Thanks,
John Bender

jbender11
1 May 2017, 10:27 AM
Nevermind. I found the solution. I was putting the String 'Y-m-d' in the dateFormat field of my model item in Architect. If I take out the single quotes and just enter Y-m-d it works as expected.