8

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?

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

this is my code.

Dhairyashil
  • 179
  • 2
  • 5
  • 18
  • What is the **input** format of the data which you use to fill the grid? Recommended source format is `ISO8601Short` ("Y-m-d" like "2013-05-18") or `ISO8601Long` ("Y-m-d H:i:s" like "2013-05-18 14:13:53") – Oleg May 18 '13 at 12:14
  • @Oleg : I am using input fomat as date. – Dhairyashil May 20 '13 at 07:19
  • My question was **which input format you use**?. You wrote only in which format you **shown** the date, but not in which format you fill the data for the grid. Do you use `datatype: "local"` and fill the data in your JavaScript code or you use `datatype: "json"` (or "xml") and returns data from the server? – Oleg May 20 '13 at 07:54
  • @Oleg: oh sorry for mistake. I have used datatype : "json". – Dhairyashil May 20 '13 at 08:04
  • which input format for data you use? – Oleg May 20 '13 at 08:16
  • @Oleg: I am sending date object as "String"(i.e.milliseconds) from server and in JavaScript code I am using `datatype: "json"` – Dhairyashil May 20 '13 at 08:26
  • @Oleg: My date is like "FRI MAY 17 00:00:00 IST 2013" ,where "IST" is "TimeZone",but I dont know what is its source format. – Dhairyashil May 20 '13 at 09:25

3 Answers3

15

Try these:

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

Given here: JQgrid json date format

Community
  • 1
  • 1
Pragnesh Rupapara
  • 782
  • 1
  • 12
  • 30
0

Try this!!!

{name:'checkin', index:'checkin', width:60, formatter: 'date', 
     formatoptions: { newformat: 'd/m/Y'}, 
     searchoptions:{sopt:['eq']}},
kleopatra
  • 51,061
  • 28
  • 99
  • 211
0

Try this one:

formatter: 'date', formatoptions: { srcformat: 'l, F d, Y', newformat: 'd/m/Y'}
brasofilo
  • 25,496
  • 15
  • 91
  • 179
Jayesh
  • 19
  • 1