Asp.net mvc 4 Jqgrid日期时间格式排序问题

Asp.net mvc 4 Jqgrid日期时间格式排序问题,asp.net-mvc-4,jqgrid,Asp.net Mvc 4,Jqgrid,我有一个从后端返回的日期时间格式(dd/MM/yyyy HH:MM:ss) JQgrid的列值为{name:'createddate',index'createddate',sorttype:'date',formatter:'date'} 但排序工作不正常 结果显示如下:例如 2013年11月6日01:23:33 2013年9月11日02:22:34 20/09/2013 01 22:33 但所需的结果是: 2013年9月11日02:22:34 2013年9月20日01:22:33 2013年

我有一个从后端返回的日期时间格式(dd/MM/yyyy HH:MM:ss)

JQgrid的列值为{name:'createddate',index'createddate',sorttype:'date',formatter:'date'}

但排序工作不正常

结果显示如下:例如

2013年11月6日01:23:33

2013年9月11日02:22:34

20/09/2013 01 22:33

但所需的结果是:

2013年9月11日02:22:34

2013年9月20日01:22:33

2013年11月6日01:23:33


提前感谢。

如果您使用
格式化程序:'date'
,则应使用
srcformat
newformat
选项指定
formattoptions
。输入数据的默认格式(
srcformat
)应为
formatter:'date'
的格式为
ISO8601Short
:“Y-m-d”。您使用另一种格式,因此必须指定
srcformat
。使用jqGrid的日期格式是PHP格式(已描述)。因此,我认为通过添加

formatoptions:{srcformat:“d/m/Y H:i:s”,newformat:“d/m/Y H:i:s”}
如果从服务器返回数据,最好使用ISO-8601格式。它是独立于语言环境的格式。您可以在服务器端使用
DateTime.ToString(“o”)
DateTime.UtcNow.ToString(“o”)
。在这种情况下,您可以将
formatoptions
更改为

formatoptions:{srcformat:“ISO8601Long”,newformat:“d/m/Y H:i:s”}

如果使用
格式化程序:'date'
则应使用
srcformat
newformat
选项指定
formattoptions
。输入数据的默认格式(
srcformat
)应为
formatter:'date'
的格式为
ISO8601Short
:“Y-m-d”。您使用另一种格式,因此必须指定
srcformat
。使用jqGrid的日期格式是PHP格式(已描述)。因此,我认为通过添加

formatoptions:{srcformat:“d/m/Y H:i:s”,newformat:“d/m/Y H:i:s”}
如果从服务器返回数据,最好使用ISO-8601格式。它是独立于语言环境的格式。您可以在服务器端使用
DateTime.ToString(“o”)
DateTime.UtcNow.ToString(“o”)
。在这种情况下,您可以将
formatoptions
更改为

formatoptions:{srcformat:“ISO8601Long”,newformat:“d/m/Y H:i:s”}

如果使用
格式化程序:'date'
则应使用
srcformat
newformat
选项指定
formattoptions
。输入数据的默认格式(
srcformat
)应为
formatter:'date'
的格式为
ISO8601Short
:“Y-m-d”。您使用另一种格式,因此必须指定
srcformat
。使用jqGrid的日期格式是PHP格式(已描述)。因此,我认为通过添加

formatoptions:{srcformat:“d/m/Y H:i:s”,newformat:“d/m/Y H:i:s”}
如果从服务器返回数据,最好使用ISO-8601格式。它是独立于语言环境的格式。您可以在服务器端使用
DateTime.ToString(“o”)
DateTime.UtcNow.ToString(“o”)
。在这种情况下,您可以将
formatoptions
更改为

formatoptions:{srcformat:“ISO8601Long”,newformat:“d/m/Y H:i:s”}

如果使用
格式化程序:'date'
则应使用
srcformat
newformat
选项指定
formattoptions
。输入数据的默认格式(
srcformat
)应为
formatter:'date'
的格式为
ISO8601Short
:“Y-m-d”。您使用另一种格式,因此必须指定
srcformat
。使用jqGrid的日期格式是PHP格式(已描述)。因此,我认为通过添加

formatoptions:{srcformat:“d/m/Y H:i:s”,newformat:“d/m/Y H:i:s”}
如果从服务器返回数据,最好使用ISO-8601格式。它是独立于语言环境的格式。您可以在服务器端使用
DateTime.ToString(“o”)
DateTime.UtcNow.ToString(“o”)
。在这种情况下,您可以将
formatoptions
更改为

formatoptions:{srcformat:“ISO8601Long”,newformat:“d/m/Y H:i:s”}