title: Disable a particular date in UIDatePicker
body: <p>I was trying to set up a uidatepicker for booking some events in the calendar.
  I need to disable (hide) some particular dates in my UIDatePicker, for instance days when I'm out of town or on vacation.</p>
  
  <p>Can you help me with this one?
  Thanx a lot in advance.
  Here is some code:</p>
  
  <pre><code> - (void)viewDidLoad
   {
  
  
       NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"IT"];
       [self.datePicker setLocale:locale];
  
       NSString *min = @"20132015";
       NSString *max = @"22132015";
  
       NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
       [dateFormat setDateFormat:@"ddMMyyyy HH:mm"];
       NSDate *datemin = [dateFormat dateFromString:min];
       NSDate *datemax = [dateFormat dateFromString:max];
  [self.view addSubview:datePicker];
  datePicker.minuteInterval = 15;
  datePicker.maximumDate = datemax;
  datePicker.minimumDate = [NSDate date];
  
       [datePicker addTarget:self action:@selector(disableDate)      forControlEvents:UIControlEventValueChanged];
  
  [datePicker addTarget:self
                  action:@selector(LabelChange:)
        forControlEvents:UIControlEventValueChanged];
  
  
  [super viewDidLoad];
  // Do any additional setup after loading the view.
   }
  
   -(void)disableDate{
  
  NSDate *pickedDate = datePicker.date;  // Get current Date
  NSDate *disabledDate = [?????;
  if([pickedDate compare:disabledDate] == NSOrderedSame)
  {
      [datePicker setDate:disabledDate animated:YES];
  
  }
   }
        -(void)getDisableDate
   {
  ?????
   }
  
  
   - (void)LabelChange:(id)sender{
  
  
       NSDateFormatter *df = [[NSDateFormatter alloc] init];
       [df setDateFormat:@"dd.MM.yyyy HH:mm"];
       NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"IT"];
       [self.datePicker setLocale:locale];
  
       labelDate.text = [NSString stringWithFormat:@"%@",
                      [df stringFromDate:datePicker.date]];
  
       NSLog(@"date:%@", datePicker.date);
  
  
   }
  </code></pre>