Open royherma opened 8 years ago
I remember to have seen this but I am not seeing it anymore. In which version have you seen this bug?
And how exactly are you setting up this DatePicker?
Version 3.1.0 . Here is an example of my usage:
XLFormRowDescriptor *row;
row = [XLFormRowDescriptor formRowDescriptorWithTag:kStartDateCell
rowType:XLFormRowDescriptorTypeDate];
row.title = NSLocalizedString(@"Start Date", nil);
row.value = self.ooo.startDate.isValid ? self.ooo.startDate : nil;
row.required = YES;
row.requireMsg = @"You must specify a start date";
row.valueTransformer = K2FormDatePickerFormatter.class;
[K2FormViewController setTitleFontForRow:row forKey:@"textLabel.font"];
[K2FormViewController setTitleTextColorForRow:row forKey:@"textLabel.textColor"];
[K2FormViewController setFontForRow:row forKey:@"detailTextLabel.font"];
[K2FormViewController setTextColorForRow:row forKey:@"detailTextLabel.textColor"];
[row.cellConfig setObject:[UIColor whiteColor] forKey:@"datePicker.backgroundColor"];
[row.cellConfig setObject:[NSDate date] forKey:@"minimumDate"];
Tried your code and it works perfectly for me. Check out if it works for you with master branch.
(P.S. the only thing I commented out was the setting of fonts and text colors)
The user needs to scroll up or down and back to the original value in order for it to be set. Should have the value set on popup/display of the UIDatePicker/PickerView (or at least an option to turn on this functionality)