-
8 Aug 2007 9:03 PM #1
[SOLVED] dateField formatting problem
[SOLVED] dateField formatting problem
I've got some dateField areas on one of my forms to allow so that I can read in dates. The problem that I'm facing is that I need to interact with a back-end system that reads dates as the "Unix" style of "YYYY-MM-DD" and my customer needs to see the dates in the format "d/m/YYYY" when they are entered into the dateField area.
I know that I can set the format to be the correct one as far as the display goes, but how do I get the format correct when I'm submitting the dates to the remote script that needs them in a different format? I've looked and can't see anything that can help me on this one.
-
9 Aug 2007 2:04 PM #2
Is there no way to do this? I thought there'd have to be something out there that'd work?

-
9 Aug 2007 2:33 PM #3
Maybe...
where 'datafield' is the id or name of the Ext.form.DateField in the form and dateWithFormat is the parameter received by the script in the server side...Code:form.submit( { failure: function() {...}, params: { ... dateWithFormat: form.findField('datefield').getValue().format('Y/m/d'), ... }, success: function() {...} url: '...' } );
-
9 Aug 2007 3:28 PM #4
Wolverine... You're a complete legend! Works perfectly. Thanks for helping out.


Reply With Quote