mwermuth / MWDatePicker

Customize the good ol' UIDatePicker
MIT License
102 stars 22 forks source link

Disable Past Date in UIDatePicker? #3

Open fabiosoft opened 11 years ago

fabiosoft commented 11 years ago

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]];

mwermuth commented 11 years ago

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?

fabiosoft commented 11 years ago

Amazing!

mwermuth commented 11 years ago

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?

fabiosoft commented 11 years ago

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)....

mwermuth commented 11 years ago

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