Skip to content

Instantly share code, notes, and snippets.

@gliubc
Created December 17, 2018 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gliubc/04f527350e7e1ed1d69adad17fd9d38e to your computer and use it in GitHub Desktop.
Save gliubc/04f527350e7e1ed1d69adad17fd9d38e to your computer and use it in GitHub Desktop.
- (IBAction)buttonStartTimeClicked:(id)sender {
WSDatePickerView *datePickerView = [[WSDatePickerView alloc] initWithDateStyle:DateStyleShowYearMonthDay scrollToDate:self.startDate CompleteBlock:^(NSDate *date) {
self.startDate = date;
self.textFieldStartTime.text = [self format:date];
}];
[datePickerView show];
}
- (NSString *)format:(NSDate *)date {
NSDateFormatter *formatter = [NSDateFormatter new];
formatter.dateFormat = @"yyyy-MM-dd";
return [formatter stringFromDate:date];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment