1. #1
    Sencha User
    Join Date
    May 2010
    Posts
    3
    Vote Rating
    0
    rachata is on a distinguished road

      0  

    Default How to disable date in DatePicker past date

    How to disable date in DatePicker past date


    Could you please help me? I would like to know How to disable date in past on DatePicker?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,604
    Vote Rating
    818
    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


    So you only want to be able to pick future dates?

    Code:
    {
        xtype: "datefield",
        ...
        minValue: new Date()
    }
    http://dev.sencha.com/deploy/dev/doc...form.DateField
    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
    May 2010
    Posts
    3
    Vote Rating
    0
    rachata is on a distinguished road

      0  

    Default


    Thank you Mitchell Simoens

  4. #4
    Sencha User
    Join Date
    Aug 2011
    Posts
    36
    Vote Rating
    0
    ikim is on a distinguished road

      0  

    Default


    Is there no similar option for the Touch 2 DatePicker?
    http://docs.sencha.com/touch/2-0/#!/...eld.DatePicker

  5. #5
    Touch Premium Member
    Join Date
    Nov 2011
    Posts
    124
    Vote Rating
    0
    JavascriptParrot is on a distinguished road

      0  

    Default


    Same question here...

  6. #6
    Sencha User
    Join Date
    Jun 2009
    Location
    Burlington, Ontario
    Posts
    174
    Vote Rating
    2
    Bleak is on a distinguished road

      0  

    Default


    minValue: new Date() works ok for initial entry, but if it is part of a previously entered record and you load that form, the field becomes invalid since that date has passed.

    If I wanted to disable the dates from the Date Picker, but not impact the form validation, would I have to use the disabledDates config?

Similar Threads

  1. How do you set the date in DatePicker?
    By profunctional in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 19 Jul 2010, 10:14 PM
  2. Can't setMaxValue for DatePicker to a past date
    By phamtranquocviet in forum Ext GWT: Help & Discussion (1.x)
    Replies: 0
    Last Post: 30 May 2009, 12:42 PM
  3. How can select future day date only not a past date and current date
    By painter in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 6 Apr 2009, 10:11 PM
  4. Newbie Question about disable shadow of the date picker's date field
    By fm424946 in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 13 Nov 2007, 9:02 AM

Thread Participants: 4

Tags for this Thread