Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chrono1081

macrumors G3
Original poster
Jan 26, 2008
8,811
5,751
Isla Nublar
Hi guys,

I have a UIDatePicker item and I already set the minimum and maximum dates but I want only the dates between the minimum and maximum dates to display in the date picker.

(For example if the minimum date was Jan 1 1980 and the maximum date was Jan 1 2000 I only want the dates between Jan 1 1980 and Jan 1 2000 to display in the date picker.

Currently with minimum and maximum set any other date is visible, the date picker just scrolls back to the minimum or maximum when it is selected.

I didn't see any method that looks like it would accomplish this. Does anyone have any ideas?
 
For maximum flexibility, I suggest implementing your own date picker by using an UIPickerView
 
For maximum flexibility, I suggest implementing your own date picker by using an UIPickerView

Thanks. Yea thats what it looks like I'm going to have to do.

I'm not sure quite how to do it but I'll work on figuring it out this weekend.

My guess is something like:

-Initialize a picker with the correct columns and rows
-Magically populate the rows with NSCalendar Dates
-Handle events.

I'll have to do some digging in NSCalendar.
 
Having just seen this blow up an international deployment (not iDevice), make sure you understand how you'll be working with date / time formats.

Part of the system I was involved with rolling out blew up in a few Asian countries due to differences between system date / time settings, what the program expected, and even the fact that AM/PM is represented by different characters in different languages. Have to do a full regression test just to change a tiny section of code to handle this issue.
 
Having just seen this blow up an international deployment (not iDevice), make sure you understand how you'll be working with date / time formats.

Part of the system I was involved with rolling out blew up in a few Asian countries due to differences between system date / time settings, what the program expected, and even the fact that AM/PM is represented by different characters in different languages. Have to do a full regression test just to change a tiny section of code to handle this issue.

Thanks for the heads up. This app is an in house app and will only be used in the U.S. (and most likely only one state) but I will look in to it just to be safe.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.