-
18 Apr 2012 4:36 AM #1
Overridden date format in Ext.plugin.PullRefresh
Overridden date format in Ext.plugin.PullRefresh
REQUIRED INFORMATION:
- ST2
- Date format provided by user in config is overriden with default format "m/d/Y h:iA"
- example config: pullTpl: [ '<div class="x-list-pullrefresh">',
'<div class="x-list-pullrefresh-arrow"></div>',
'<div class="x-loading-spinner">',
'<span class="x-loading-top"></span>',
'<span class="x-loading-right"></span>',
'<span class="x-loading-bottom"></span>',
'<span class="x-loading-left"></span>',
'</div>',
'<div class="x-list-pullrefresh-wrap">',
'<h3 class="x-list-pullrefresh-message">{message}</h3>',
'<div class="x-list-pullrefresh-updated">Last changed: <span>{lastUpdated:date("d/m/Y H:i")}</span></div>',
'</div>',
'</div>'
].join('') - overridden in sencha-touch-all-debug.js, line 62639, me.updatedEl.setHtml(Ext.util.Format.date(me.lastUpdated, "m/d/Y h:iA"));
- Date format provided by user in config "d/m/Y H:i" is overriden with "m/d/Y h:iA". This is done on second pull to refresh action.
-
18 Apr 2012 5:59 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
In 2.0.1 RC the two format strings are the same "m/d/Y h:iA". Is this thread to make it configurable then?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
18 Apr 2012 7:33 AM #3
It is configurable, but it is not working correctly. User can set custom date format in pullTpl config:
Code:'<div class="x-list-pullrefresh-updated">Last changed: <span>{lastUpdated:date("d/m/Y H:i")}</span></div>',
If you set this in your pullTpl config, first pull action will show correct date. But next pull will use default hardcoded date format and user's configured format is lost. This is because of:
Code:me.updatedEl.setHtml(Ext.util.Format.date(me.lastUpdated, "m/d/Y h:iA"));
in method resetRefreshState in Ext.plugin.PullRefresh class.
-
18 Apr 2012 8:39 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
Configurable meaning that you need to set a config to use the same. The line with the date format won't be able to get the date format string from the template.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
24 Oct 2012 1:29 AM #5
Old thread but still true with 2.0.1
Can we resolve this issue ? How ?
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.


Reply With Quote