3

大家好,我正在使用 JQ Grid,我得到的日期格式是 2012-09-16T00:00:00 这样的。我希望日期格式为 2012-09-16 方式。我试图改变它,但它不起作用。请查看我的代码并告诉我哪里出错了。

格式化程序:'日期',格式选项:{'srcformat':'Ymd H:i:s','newformat':'Ymd'}

4

4 回答 4

2

用您的代码替换下面的 colModel

{name:'createDate',index:'createdDate', width:80, formatter : 'date', formatoptions : {newformat : 'Y-m-d'} },
于 2014-02-13T11:41:53.137 回答
2

抱歉,我无法重现您的问题。例如,请参见演示

于 2013-06-04T07:52:47.880 回答
2

它可以帮助你!!!

<sjg:gridColumn name="___" index="___" title="Date" sortable="true" width="70" align="right" formatter="date" formatoptions= "{srcformat:'y-m-d', newformat: 'Y-m-d' }"/>
于 2014-03-19T06:28:56.187 回答
0

升级到 4.8。我有同样的问题,我想我也在使用 4.5。

于 2015-03-26T23:47:22.613 回答