jQuery 如何在 jqgrid 中更改日期格式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16623951/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 17:29:17  来源:igfitidea点击:

How to change date format in jqgrid

jqueryjqgridjqgrid-formatter

提问by Dhairyashil

I have one issue related to jqgrid. I have date shown in jqgrid table like "FRI MAY 17 00:00:00 IST 2013" .I want to change its format to "17/5/2013".how i can do it?

我有一个与 jqgrid 相关的问题。我在 jqgrid 表中显示了日期,例如“FRI MAY 17 00:00:00 IST 2013”​​。我想将其格式更改为“17/5/2013”​​。我该怎么做?

{name:'checkin', index:'checkin', width:60, searchoptions:{sopt:['eq']}},

this is my code.

这是我的代码。

回答by Pragnesh Rupapara

Try these:

试试这些:

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

Given here: JQgrid json date format

此处给出:JQgrid json 日期格式

回答by Gangadhar

Try this!!!

尝试这个!!!

{name:'checkin', index:'checkin', width:60, formatter: 'date', 
     formatoptions: { newformat: 'd/m/Y'}, 
     searchoptions:{sopt:['eq']}},

回答by Jayesh

Try this one:

试试这个:

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