Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3179 in a recent build.
  1. #1
    Touch Premium Member
    Join Date
    Aug 2011
    Posts
    34
    Vote Rating
    0
    Pandorian is on a distinguished road

      0  

    Default [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
    Browser versions tested against:
    • Chrome (20) (Win7)
    DOCTYPE tested against:
    • HTML5
    Description:

    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
    See this URL for live test case: http://




    Debugging already done:
    • none
    Possible fix:
    • not provided
    Additional CSS used:

    Operating System:

    Win7
    Attached Images
    Attached Files

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,643
    Vote Rating
    816
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the report.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    36
    Vote Rating
    1
    DonM is on a distinguished road

      0  

    Default Workaround?

    Workaround?


    Does anyone know of a work around for this? It's preventing me from further developing a crucial part of my application.

  4. #4
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Berne, Switzerland
    Posts
    714
    Vote Rating
    42
    ingo.hefti has a spectacular aura about ingo.hefti has a spectacular aura about ingo.hefti has a spectacular aura about

      0  

    Default


    Quote Originally Posted by DonM View Post
    Does anyone know of a work around for this? It's preventing me from further developing a crucial part of my application.
    This is still the case in V2.1 final?

  5. #5
    Sencha User
    Join Date
    Apr 2012
    Posts
    36
    Vote Rating
    1
    DonM is on a distinguished road

      0  

    Default


    Quote Originally Posted by ingo.hefti View Post
    This is still the case in V2.1 final?
    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" }

  6. #6
    Sencha Touch Premium User
    Join Date
    Nov 2012
    Posts
    25
    Vote Rating
    0
    senchacyber is on a distinguished road

      0  

    Default


    ....

  7. #7
    Sencha User
    Join Date
    Apr 2012
    Posts
    36
    Vote Rating
    1
    DonM is on a distinguished road

      0  

    Default


    Quote Originally Posted by senchacyber View Post
    ....
    Did you make an account just to post 4 dots on the forum?

  8. #8
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    15
    Vote Rating
    2
    cbobo is on a distinguished road

      0  

    Default


    I've been working with this problem, and have found a workaround.

    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;
         }
    }
    Override the parse function for MS format in DateExtras with this.