【问题标题】:JQ Grid Date FormatJQGrid 日期格式
【发布时间】:2013-05-30 10:37:28
【问题描述】:

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

格式化程序:'日期',格式选项:{'srcformat':'Y-m-d H:i:s','newformat':'Y-m-d'}

【问题讨论】:

  • 你使用哪个版本的 jqGrid?

标签: jqgrid jqgrid-formatter


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    用你的代码替换下面的 colModel

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

    【讨论】:

      【解决方案3】:

      它可以帮助你!!!

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

      【讨论】:

        【解决方案4】:

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

        【讨论】:

          猜你喜欢
          • 2018-05-13
          • 2012-05-24
          • 2012-03-07
          • 1970-01-01
          • 2014-09-02
          • 2012-08-01
          • 1970-01-01
          • 2011-09-22
          相关资源
          最近更新 更多