-
15 Sep 2012 8:19 AM #1
Unanswered: Ext.util.Format.date question
Unanswered: Ext.util.Format.date question
Why does this:
return this? 2012/09/13 and not 2012/09/14Code:Ext.util.Format.date('2012-09-14', 'Y/m/d');
-
15 Sep 2012 9:22 AM #2
-
15 Sep 2012 9:31 AM #3
-
15 Sep 2012 12:36 PM #4
Hi what browser and what ExtJS version - I tested it in Chrome, IE9, Firefox with ExtJS 4.1.1 and it worked fine
-
15 Sep 2012 12:54 PM #5Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,185
- Vote Rating
- 194
- Answers
- 433
What I use is:
For format.date, use:
For the field define for date field use:Ext.util.Format.date('2012/09/14', 'Y/m/d');
Scott.{ name : 'date_field', type : 'date', dateFormat : 'Y-m-d' },
-
15 Sep 2012 4:08 PM #6Sencha - Ext JS Dev Team
- Join Date
- Apr 2007
- Location
- Sydney, Australia
- Posts
- 15,075
- Vote Rating
- 97
- Answers
- 168
Note:
What does Date.parse return on that string?The value to format. If a string is passed, it is converted to a Date by the Javascript's built-in Date.parse method.Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
16 Sep 2012 2:30 PM #7
Code:Ext.getBody().update(Date.parse('2012-09-14'));
returns this: 1347580800000


Reply With Quote