JQgrid date format in dd-MMM-yyyy

I am using JQgrid and our date is displayed in format 20-Nov-14

, but I want to display the date in format 20-Nov-2014

with truetiy sorted true.

{ name: 'DateOfBirth', index: 'DateOfBirth',sortable: true, width: 30, formatter: 'date', formatoptions: { newformat: 'd-M-y' } }

      

+3


source to share


2 answers


You must use

formatter: 'date', formatoptions: { newformat: 'd-M-Y' }

      



with Y

instead of Y

. By the way, jqGrid uses PHP date format in format settings.

+2


source


Try



 formatter: 'date', formatoptions: {srcformat:'d-m-y', newformat: 'd-M-Y'}

      

+1


source







All Articles