2013-06-04 62 views
3

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

格式: '日期',formatoptions:{ 'srcformat': 'Y-M-d H:I:S', 'newformat': 'Y-M-d'}

+0

你使用哪个版本的jqGrid? – Oleg

+0

4.5.2是版本 –

回答

2

很抱歉,但我无法重现你的问题。例如,请参阅the demo

2

替换下面colModel与您的代码

{name:'createDate',index:'createdDate', width:80, formatter : 'date', formatoptions : {newformat : 'Y-m-d'} }, 
2

它可以帮助你!

<sjg:gridColumn name="___" index="___" title="Date" sortable="true" width="70" align="right" formatter="date" formatoptions= "{srcformat:'y-m-d', newformat: 'Y-m-d' }"/> 
0

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