Closed bhirt-bpl closed 9 years ago
I ended up creating a pull request for this feature and a couple of other minor update here https://github.com/xmartlabs/XLForm/pull/74
@bhirt-bpl You can set minimum date or maximum date like this.
row = [XLFormRowDescriptor formRowDescriptorWithTag:@"ends" rowType:XLFormRowDescriptorTypeTimeInline title:@"Ends"];
row.value = [NSDate dateWithTimeIntervalSinceNow:60*60*25];
[row.cellConfigAtConfigure setValue:[[NSDate date] dateBySubtractingYears:13] forKey:@"maximumDate"];
[row.cellConfigAtConfigure setValue:[[NSDate date] dateBySubtractingYears:20] forKey:@"minimumDate"];
Can we change min/max date properties run time ? I have 2 inline datepickers. I want to change the min/max property of second date picker based on value of first date picker. So I have added row.cellConfigAtConfigure code in formrowvaluechanged method. But its not working.
Instead of using row.cellConfigAtConfigure... I try to use the following, and it works.
[row.cellConfig setObject:minimumDate_you_want forKey:@"minimumDate"];
@brianfox201 did you have any success with that?? I am looking for the same thing.
NSDate currentDate = [NSDate date]; NSDictionary dict = @{ @"datePicker.maximumDate" : currentDate }; [row.cellConfigAtConfigure addEntriesFromDictionary: dict];
try to use
I need to set min/max dates and an interval for the selection. I can't seem to figure out how to do this with the current master branch. I've added some properties to XLFormDateCell to control these and updated setModeToDatePicker: to set the options on the date picker.
Then in my form setup I can do this to get the desired effect:
If there is another way to do this without modifying the XLForm code, let me know. If this feature isn't currently supported and my solution seems acceptable to you, I can submit a pull request.