JQgrid日期格式为dd-MMM-yyyy。

3

我正在使用JQgrid,日期显示的格式是20-Nov-14,但我想以可排序的方式将日期显示为20-Nov-2014格式。

{ name: 'DateOfBirth', index: 'DateOfBirth',sortable: true, width: 30, formatter: 'date', formatoptions: { newformat: 'd-M-y' } }
2个回答

2

你应该使用

formatter: 'date', formatoptions: { newformat: 'd-M-Y' }

使用Y替代y。顺便提一下,jqGrid在格式选项中使用PHP日期格式


1
尝试。
 formatter: 'date', formatoptions: {srcformat:'d-m-y', newformat: 'd-M-Y'}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接