JQgrid json日期格式 [英] JQgrid json date format

查看:162
本文介绍了JQgrid json日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个通过Json字符串传入我的JQGrid的日期,它看起来像

 31/10 / 2011

我无法通过JQGrid 文档。我只是想让它出现,然后在网格中排序。



如果我发布时没有格式化,日期看起来不错,但不被识别为日期,因此排序是错误的。



如果将以下日期格式添加到列

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

我收到了一个这样的日期

  03/10/2031 

我不能为我的生活制定出什么问题请帮忙。

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

对问题进行排序

I have a date that is passed into my JQGrid via a Json string and it looks like

"31/10/2011"

I cannot work out the formatting via the JQGrid documentation. I just want it to appear and then be sortable in the grid.

If I post without formatting, the date looks fine but is not recognised as a date, thus the sorting is all wrong.

If I add the following date formatting to the column

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

I am getting a date back that looks like this

03/10/2031

I cannot for the life of me work out what the problem is please help.

解决方案

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

sorted the problem

这篇关于JQgrid json日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆