Feature request for DatePicker: exclude a specific date
skuske opened this issue · comments
It would be cool if there was a way to exclude a specific date from being selected by the date picker (disable selection, or even hide the whole date).
Example: for a BRDatePickerModeY there should be a property to specify a year, or an array of years that should not be selectable. For other picker modes that property should store other non selectable dates etc.
Thanks! :o)
/** set non selectable dates */
@property (nullable, nonatomic, copy) NSArray <NSDate *> *nonSelectableDates;
Usage:
BRDatePickerView *datePickerView = [[BRDatePickerView alloc]init];
datePickerView.pickerMode = BRDatePickerModeYMD;
datePickerView.nonSelectableDates = @[[NSDate br_setYear:2020 month:8 day:25], [NSDate br_setYear:2020 month:8 day:28]];
datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) {
NSLog(@"selectDate=%@", selectDate);
};
[datePickerView show];
Many thanks!