PDA

View Full Version : Enable a single date in Date Picker



jinionnet
6 Jul 2012, 6:23 AM
Hi Guys,

I want to disable all the dates except first day of the month from the datepicker. ie, user can only select 1st jan, 1st feb etc. I have tried the following using setDisabledDates method.



Ext.getCmp("dtFromDate").setDisabledDates(['./2','./3', './4', './5', './6', './7', './8', './9', './10',..........'./31']);



But it is not working for me. Please help me to resolve this issue or an other alternate solution ?

Thanks in advance,
jini

Jad
6 Jul 2012, 6:44 AM
Maybe you use wrong date format ?

hasimseo
6 Jul 2012, 6:47 AM
you can use like this. the days will be disabled which are defined in brackets...
disabledDates: ["03","04","05"]

or give an id to your date vars and use like below
tb.down("#myy").setDisabledDates(["03","04"]);

if you give the code where you use the date var u will get a better solution...

jinionnet
7 Jul 2012, 2:10 AM
you can use like this. the days will be disabled which are defined in brackets...
disabledDates: ["03","04","05"]

or give an id to your date vars and use like below
tb.down("#myy").setDisabledDates(["03","04"]);

if you give the code where you use the date var u will get a better solution...

Setdiableddates is working only for few dates. I want to disable all dates from 2 to 31 that means only enable 1 for all months. Upto dates 20, 21 dates disabled as expected. After tat this method not woking. If you know an easy method to disable the dates like a regexp it would be very helpful. My code already posted in the first poat.

Tahnks
Jini

jinionnet
8 Jul 2012, 8:58 PM
Can anybody help me please?