PDA

View Full Version : datefield conversion in form



PatrickS
10 Nov 2010, 9:01 AM
Hi,

At this moment I retrieve from my direct backend a date field with the format 'Y-m-d\\T00:00:00'. In my form I need to display the datefield as 'd-m-Y'. in my form I specified my datefield like this:

{ fieldLabel: 'Van', name: 'FromDate', xtype: 'datefield', format: 'Y-m-d\\T00:00:00', anchor: '75%' }

With this format I see my datevalue in the box and the selector works nice. How can I transform it uppon reading from the backend towards d-m-Y and uppon submission back to Y-m-d\\T00:00:00 so it has the layout I need?

patrick

raj_plays
10 Nov 2010, 10:11 PM
change the format in the datefield to 'd-m-Y' and on submit do


FromDate.getValue().format('Y-m-d\TH:i:s')