I am using MySQL which stores dates in the format 'yyyy-mm-dd'.
I have a layout where one section shows a grid. The records in this grid display the date the record was first created. I need the date to be in the format of 'mm/dd/yyyy'.
This is how the date field in the grid is setup:
{ field: 'incident_date', caption: 'Incident Date', size: '150px', searchable: true, type: 'date', format: 'mm/dd/yyyy' },
I also have a form that opens for the user to edit the record. This is the date field code on that form:
{ name: 'incident_date', type: 'date', format: 'mm/dd/yyyy', required: true },
In w2ui-1.4.2.min.js I have these settings:
"date_format" : "mm/dd/yyyy",
"date_display" : "mm/dd/yyyy",
On the form the date field has a popup calendar that appears when this field is selected. When you select a date in the calendar the field gets filled in with the date you selected, in the format of "mm/dd/yyyy".
Now that you have an idea of how things are setup, when you save the record, any date you enter shows up in the grid as '0000-00-00'. if you use phpMyAdmin to look at the actual data in the table the date stored is '0000-00-00'
What I want is for the date to be displayed in the grid and in the form in the format of 'mm/dd/yyyy'. How can I accomplish this?
Thanks, TD