时间选择的bug!
abcdezg opened this issue · comments
时间选择器,时间范围限制到2020年1月1日到2020年12月31日,选择1月31日,把月份滚动到2月时,出现了bug,月份自动滚动到了3月,3月变成只有29天。经过排查发现,设置选择月、日的时候,下面的方法默认会填充今年。
- (nullable NSDate *)br_setMonth:(NSInteger)month day:(NSInteger)day;
bug fixed:
BRDatePickerView.m中
第1082行和第956行都改为以下代码即可:
self.mSelectDate = [NSDate br_setYear:[self.yearArr[self.yearIndex] intValue] month:month day:day];
代码已提交,2.7.5
最新版本因为CocoaPods账号原因暂时还没有上传,可以先直接使用
pod 'BRPickerView', :git => 'https://github.com/91renb/BRPickerView.git'
pod最新版本。