1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    14
    Vote Rating
    0
    mlourdes is on a distinguished road

      0  

    Default Invalid Date

    Invalid Date


    Hi ,
    I have two issues with date fields .

    1- how to make a datepicker to show (today- now()) by default , I tried value : new Date() , and the browser get 'newDate' and of course is undefine , even when the design view shows the correct date .

    2- the control date , has format j/m/Y , and shows the right format . But after chosing a date with the picker I get in the browser invalid proto , where and what to write the code to fix this . in order to save the model properly .

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,240
    Vote Rating
    121
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Re: 1 you will want to use an override or an event handler.

    Re: 2 I do not understand whats happening. Can you share some screenshots etc?
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    14
    Vote Rating
    0
    mlourdes is on a distinguished road

      0  

    Default Invalid date

    Invalid date


    For my first problem :

    I enter that :
    date3.PNG
    I get newDate() in browser and in code view what means that I get an invalid Date

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    14
    Vote Rating
    0
    mlourdes is on a distinguished road

      0  

    Default where to parse a date field

    where to parse a date field


    Where should I code , what to do for saving to a model a date field in a correct date format ? the date is comming from a datapicker

  5. #5
    Sencha User
    Join Date
    Sep 2011
    Location
    Paris
    Posts
    11
    Vote Rating
    0
    avrahqedivra is on a distinguished road

      0  

    Default Work around to default new Date()

    Work around to default new Date()


    use the evil way

    eval('new Date()') instead of new Date()

Thread Participants: 2