I have a datePickerView which I want it to have a min date = current time, max date = 48hrs later. It's currently working fine, as I can't pick out of that range. But there's some aesthetic problems. Some of the period in that range is not in black. For example in the picture below, today's 7hour hand is suppose to be in black but its not.
- (void)viewDidLoad
{
[super viewDidLoad];
NSDate *now = [[NSDate alloc] init];
NSLog(@"now is %@", now);
[datepick setDate:now animated:YES];
[now release];
datepick.minimumDate = now;
NSDate *todaysDate = [NSDate date];
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *dateComponents = [[NSDateComponents alloc] init];
[dateComponents setHour:48];
NSDate *targetDate = [gregorian dateByAddingComponents:dateComponents toDate:todaysDate options:0];
[dateComponents release];
[gregorian release];
datepick.maximumDate = targetDate;
NSLog(@"targetDate is %@", targetDate);
}