Salih KARAHAN
Salih KARAHAN

Reputation: 329

Why jqGrid can't convert serialized datetime json?

enter image description here

Hi, Everythink perfect without datetime on jqGrid :S How to fix this convertion problem?

Upvotes: 1

Views: 1282

Answers (3)

James
James

Reputation: 349

These column properties worked for me

formatter: "date", formatoptions: { newformat: "ISO8601Long" }

Upvotes: 0

Tony Tomov
Tony Tomov

Reputation: 3277

You will need to set the formatter to date in your colModel and jqGrid will automatically detect the Microsoft date format.

The srcformat is not needed to be set, but newformat can be.

Try this:

colModel : [
...
{name:'Mydate', ...formatter: 'date', formatoptions:{newformat 'm/d/Y'}, ...},
...
]

Upvotes: 0

Silly Volley
Silly Volley

Reputation: 483

You can try this in your ColModel

{name: 'colNmae', index: 'ColName', formatoptions: { srcformat: "ISO8601Long", newformat: "m/d/Y h:i A" }}

Or this

{name: 'colNmae', index: 'ColName', sorttype: 'date', formatter: 'date', datefmt: 'd-M-Y'},

Upvotes: 1

Related Questions