Threaded View

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Hong Kong
    Posts
    44
    Vote Rating
    0
    Answers
    6
    Winnie Lam is on a distinguished road

      0  

    Default Answered: How can I parse DateTime to Date?

    Answered: How can I parse DateTime to Date?


    Using .NET platform, return a list of DateTime in JSON format such as:

    Code:
    {"d":["\/Date(1328112000000)\/","\/Date(1328198400000)\/","\/Date(1328284800000)\/"...
    Got a model with field in date format and found a function from the net saying that it could parse the datetime to date, but seems not working. Can anyone help? Thanks a lot.
    Code:
    Ext.regModel('BookingDate', {    fields: [
            {name:'Date', type:'date', convert : toDateFromJSON }
        ]
    });
    Code:
    function toDateFromJSON(v, record) {  
             return Date.parseDate(v, "M$");
    }

  2. I solved it. Thanks

Thread Participants: 2