Permalink
Browse files

Merge pull request #440 from darrylwally/countdowntimer_fix

Fixed issue with UIDatePicker of QCountDownElement not showing proper value.
  • Loading branch information...
2 parents e60b7b2 + c6e6d85 commit 6c8c24db1e02f485dc66fd4085e9e725ecdc23ad @escoz committed Apr 8, 2013
Showing with 8 additions and 1 deletion.
  1. +3 −1 quickdialog/QDateEntryTableViewCell.m
  2. +5 −0 sample/SampleDataBuilder.m
@@ -60,8 +60,10 @@ - (void)textFieldDidBeginEditing:(UITextField *)textField {
_pickerView.minimumDate = element.minimumDate;
_pickerView.minuteInterval = element.minuteInterval;
- if (element.dateValue!=nil)
+ if (element.mode != UIDatePickerModeCountDownTimer && element.dateValue != nil)
_pickerView.date = element.dateValue;
+ else if (element.mode == UIDatePickerModeCountDownTimer && element.ticksValue != nil)
+ _pickerView.countDownDuration = [element.ticksValue doubleValue];
[super textFieldDidBeginEditing:textField];
self.selected = YES;
@@ -586,6 +586,11 @@ + (QRootElement *)createDateTimeRoot {
QDateTimeInlineElement *elDiffTime = [[QDateTimeInlineElement alloc] initWithTitle:@"Different date" date:
[NSDate dateWithTimeIntervalSinceNow:-36000] andMode:UIDatePickerModeDate];
[section addElement:elDiffTime];
+
+ QCountdownElement *countDown = [[QCountdownElement alloc] init];
+ countDown.title = @"Countdown";
+ countDown.ticksValue = [NSNumber numberWithDouble: 9780.0]; // 2Hr 43Min
+ [section addElement:countDown];
QSection *section2 = [[QSection alloc] init];
section2.title = @"Push editing";

0 comments on commit 6c8c24d

Please sign in to comment.