-
27 Jul 2012 2:07 AM #1
[2.1.0 B1] Local storage proxy does not load dates in MS format
[2.1.0 B1] Local storage proxy does not load dates in MS format
REQUIRED INFORMATION
Ext version tested:- Touch 2.1.0 Beta 1
- Chrome (20) (Win7)
- HTML5
The Local Storage proxy saves dates in MS date format, but will not read them back into a store.
Steps to reproduce the problem:
Run the supplied Test Case
Click on Load Server
Reload the browser
Click on Load Local
The result that was expected:
When the Load Local button is clicked is clicked, the dates should be displayed the same as when saved.
The result that occurs instead:
The date field is null.
Test Case:
See attached
HELPFUL INFORMATION
Screenshot or Video:- attached
Debugging already done:- none
- not provided
Operating System:
Win7
-
27 Jul 2012 7:42 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
Thanks for the report.
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.
-
13 Nov 2012 11:48 AM #3
Workaround?
Workaround?
Does anyone know of a work around for this? It's preventing me from further developing a crucial part of my application.
-
13 Nov 2012 12:10 PM #4
-
15 Nov 2012 1:47 PM #5
I just upgraded to 2.1 from 2.0.1 to find out, and yep, it still exists in the current 2.1 release.
It's showing the data fine in local storage: "DoneDate":"\\/Date(1352394180000)\\/"
but when it actually goes to load it up in the model it shows up as null. I have the field as:
{ name: 'DoneDate', type: 'date', dateFormat: "MS" }
-
15 Nov 2012 5:31 PM #6
-
19 Nov 2012 7:07 AM #7
-
3 Dec 2012 1:56 PM #8
I've been working with this problem, and have found a workaround.
Override the parse function for MS format in DateExtras with this.Code:parseFunctions: { "MS": function(input, strict) { // note: the timezone offset is ignored since the MS Ajax server sends // a UTC milliseconds-since-Unix-epoch value (negative values are allowed) var re = new RegExp('\\\\?/Date\\(([-+])?(\\d+)(?:[+-]\\d{4})?\\)\\\\?/'); var r = (input || '').match(re); return r? new Date(((r[1] || '') + r[2]) * 1) : null; } }
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3179
in
Sprint 29.


Reply With Quote