Sort and format jqgrid dates

I need to display the date in two formats, such as mm / dd / yyyy and mm / dd / yyyy hh: mm: ss. I found that we can use formatoptions in colmodel

formatoptions: {srcformat: 'ISO8601Long', newformat: 'm/d/y'}

and

formatoptions: {srcformat: 'ISO8601Long', newformat: 'm/d/y h:i:s'}

but I get output in jqgrid as mm / dd / yy. Will anyone give a decision on how to display mm / dd / yyyy. I need to do a sort for both columns.

Thanks in advance

+5
source share
2 answers

You can use "Y" instead of "y" to display the year as "yyyy" instead of "yy":

formatter:'date', formatoptions: {srcformat:'ISO8601Long', newformat:'m/d/Y H:i:s'}

, mounth tha da ( ), "n/j/Y" "m/d/Y". , , .

. , srcformat ISO8601Long, UniversalSortableDateTime, ShortDate .. (. ) (datatype:'json' datatype:xml). , srcformat:'ISO8601Long' srcformat:'Y-m-d H:i:s'.

, .

, srcformat jqGrid. trirand. ( jqGrid) jqGrid.

+6

. jqgrid ( json), dd/mm/yyyy.

formatter: 'date', formatoptions: {srcformat: 'ISO8601Long', newformat: 'd/m/Y'}

.

0

All Articles