Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request for DatePicker: exclude a specific date #178

Closed
skuske opened this issue Aug 24, 2020 · 2 comments
Closed

Feature request for DatePicker: exclude a specific date #178

skuske opened this issue Aug 24, 2020 · 2 comments

Comments

@skuske
Copy link
Contributor

skuske commented Aug 24, 2020

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)

@agiapp
Copy link
Owner

agiapp commented Aug 27, 2020

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

@skuske
Copy link
Contributor Author

skuske commented Aug 27, 2020

Many thanks!

@agiapp agiapp closed this as completed in 692fe6f Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants