PDA

View Full Version : Date field type



seek
25 Jan 2011, 12:37 AM
Hi all,
I'm going crazy with date format in JsonStore...
I can not read this data stream

{count:3,items:[
{"ResourceId":"GBA101","Id":"GBA101","Name":"FUST A PO 1","StartDate":"2011-02-08 16:00:00.0","EndDate":"2011-02-08 16:30:00.0"},
{"ResourceId":"IBA104","Id":"IBA104","Name":"MART 4","StartDate":"2011-02-08 16:00:00.0","EndDate":"2011-02-08 16:30:00.0"},
{"ResourceId":"IBA104","Id":"IBA104","Name":"MART 4","StartDate":"2011-02-08 16:00:00.0","EndDate":"2011-02-08 16:30:00.0"}
]}
with store:
....
fields: [
{name: 'ResourceId', type:'string'},
{name: 'StartDate', type: 'date', dateFormat:'Y-m-d H:i:sO'},
{name: 'EndDate', type: 'date', dateFormat:'Y-m-d H:i:sO'},
{name: 'Name', type:'string'}
]...

I tried also with:
....
fields: [
{name: 'ResourceId', type:'string'},
{name: 'StartDate', type: 'date', dateFormat:'c'},
{name: 'EndDate', type: 'date', dateFormat:'c'},
{name: 'Name', type:'string'}
]...


but nothig to do.... :-(

Where I'm wrong?

Thanks
Seek

25 Jan 2011, 11:43 AM
is "2011-02-08 16:00:00.0" a valid date format?

valititi
25 Jan 2011, 11:53 AM
:-) answer to jay...
"2011-02-08 16:00:00.0" is not correct ! the are no miliseconds format in datetime fields :-)

25 Jan 2011, 11:55 AM
:-) answer to jay...
"2011-02-08 16:00:00.0" is not correct ! the are no miliseconds format in datetime fields :-)

That's coming back from the server though :)

valititi
25 Jan 2011, 11:56 AM
yes, i saw. there must be at least a strange sql which returns that, or even a strange db engine... :-)

25 Jan 2011, 11:57 AM
maybe a special column type?

valititi
25 Jan 2011, 2:01 PM
verify your sql. it seems that you select a date as a float... it castes somehow into a float ! maybe from this reason you have the ".0" at the end of your dates !

seek
26 Jan 2011, 12:07 AM
Thanks guys, some kind of JDBC issue on Oracle, solved with specific conversion in query...

Seek