MWDatePicker icon indicating copy to clipboard operation
MWDatePicker copied to clipboard

Disable Past Date in UIDatePicker?

Open fabiosoft opened this issue 11 years ago • 5 comments

I am using a your amazing datePicker in my iOS Application and my requirement is to allow the user to choose the future date only from the DatePicker.

To do this i want to disable past date & time in DatePicker only instead of putting a compare validation in the code.

Is this possible or there is an option to disable the past date in the DatePicker control itself??

With standard UIDatePicker i do something like this... [picker setMinimumDate: [NSDate date]];

fabiosoft avatar Aug 30 '13 23:08 fabiosoft

Hey,

I have some todos for the MWDatePicker on my List. I think I can conplete some of them next week. Your feature should be easy to implement ;)

I will write here when I commit the changes ok?

mwermuth avatar Aug 31 '13 17:08 mwermuth

Amazing!

fabiosoft avatar Aug 31 '13 19:08 fabiosoft

Hi,

I added a [MWDatePicker setMinimumDate:(NSDate*)minDate] function. Can you check the functionality, if this works as expected? It is in the latest master branch.

I think this is want you wanted?

mwermuth avatar Sep 07 '13 09:09 mwermuth

It doesn't work properly... i think there is something wrong in getDate method because it returns right time but wrong date (something like january 1971)....

fabiosoft avatar Sep 10 '13 13:09 fabiosoft

Oh sorry, I forgot something ;) I made a new commit. Can you check it out? Thanks!

mwermuth avatar Sep 13 '13 13:09 mwermuth