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

设置时间的上下限直接崩溃 #30

Closed
WHaveFun opened this issue Mar 27, 2018 · 5 comments
Closed

设置时间的上下限直接崩溃 #30

WHaveFun opened this issue Mar 27, 2018 · 5 comments

Comments

@WHaveFun
Copy link

[BRDatePickerView showDatePickerWithTitle:@"请选择开始时间" dateType:UIDatePickerModeDateAndTime defaultSelValue:@"2018-03-27 00:00:00" minDateStr:@"2018-03-21 15:00:00" maxDateStr:@"2018-04-05 16:00:00" isAutoSelect:NO themeColor:nil resultBlock:^(NSString *selectValue) {
MYLog(@"------%@",selectValue);
}];

@agiapp
Copy link
Owner

agiapp commented Mar 27, 2018

你好,不要传秒数就可以。
[BRDatePickerView showDatePickerWithTitle:@"请选择开始时间" dateType:UIDatePickerModeDateAndTime defaultSelValue:@"2018-03-27 00:00" minDateStr:@"2018-03-21 15:00" maxDateStr:@"2018-04-05 16:00" isAutoSelect:NO themeColor:nil resultBlock:^(NSString *selectValue) {
MYLog(@"------%@",selectValue);
}];

我下个版本修复一下这个bug,谢谢你的提醒

@agiapp
Copy link
Owner

agiapp commented Mar 28, 2018

你好,我在原来的版本2.1.3上修复了这个bug。

  1. 注意:参数 defaultSelValue 值的格式要与 显示类型dateType 相互对应。
    UIDatePickerModeTime:HH:mm
    UIDatePickerModeDate:yyyy-MM-dd
    UIDatePickerModeDateAndTime:yyyy-MM-dd HH:mm
    UIDatePickerModeCountDownTimer:HH:mm
    如果参数 defaultSelValue 的值为空或值格式不正确时,我把defaultSelValue的值重置为了当前时间,就会默认选择到当前的时间上。不会再出现之前的崩溃现象。

  2. 参数 minDateStr 和 maxDateStr 的格式都是:yyyy-MM-dd HH:mm:ss
    格式错误时,最值不会生效。

@WHaveFun
Copy link
Author

好的我试试

@WHaveFun
Copy link
Author

[BRDatePickerView showDatePickerWithTitle:@"请选择开始时间" dateType:UIDatePickerModeDateAndTime defaultSelValue:@"" minDateStr:@"2018-03-24 18:00" maxDateStr:@"2018-03-31 18:00" isAutoSelect:NO themeColor:[UIColor redColor] resultBlock:^(NSString *selectValue) {
MYLog(@"------%@",selectValue);
2018-03-28 5 18 42
}];

时间设置上下限 无效。。。。

@agiapp
Copy link
Owner

agiapp commented Mar 28, 2018

注意:参数 minDateStr 和 maxDateStr 的格式都是:yyyy-MM-dd HH:mm:ss(格式错误时,时间上下限不会生效)
[BRDatePickerView showDatePickerWithTitle:@"请选择开始时间" dateType:UIDatePickerModeDateAndTime defaultSelValue:@"" minDateStr:@"2018-03-24 18:00:00" maxDateStr:@"2018-03-31 18:00:00" isAutoSelect:NO themeColor:[UIColor redColor] resultBlock:^(NSString *selectValue) {
MYLog(@"------%@",selectValue);
}];

@agiapp agiapp closed this as completed Oct 22, 2021
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