https://github.com/rushisangani/rsdatepickercontroller
Show DatePicker or TimePicker in iPhone, iPad with an ease.
https://github.com/rushisangani/rsdatepickercontroller
Last synced: 6 months ago
JSON representation
Show DatePicker or TimePicker in iPhone, iPad with an ease.
- Host: GitHub
- URL: https://github.com/rushisangani/rsdatepickercontroller
- Owner: rushisangani
- License: mit
- Created: 2016-06-12T08:20:18.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-13T14:31:57.000Z (about 9 years ago)
- Last Synced: 2025-03-24T01:35:26.520Z (7 months ago)
- Language: Objective-C
- Homepage:
- Size: 101 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RSDatePickerController
The convinient control to show **UIDatePicker** for Date and Time selection.
RSDatePickerController can be used to show Date Picker or Time Picker from any View/ViewController. 
## Features
- Show Date/Time Picker as a ViewController in iPhone and as a PopOverController in iPad.
- Specify any Date/Time format to get selected date or time in secified format.
- Specify Maximum and Minimum date to control DatePicker behaviour.
- Automatic dimiss on Tap outside.
- Reset, Done buttons along with Title are visible in the toolbar which is attched to DatePickerView.## How To Use
### Show DatePicker
```objective-c
[[RSDatePickerController sharedInstance] showDatePickerWithDate:nil dateFormat:nil fromView:sender inViewController:self];
```### Show TimePicker
```objective-c
[[RSDatePickerController sharedInstance] showTimePickerWithDate:nil dateFormat:nil fromView:sender inViewController:self];
```### Show DatePicker from UITextField
```objective-c
[textField addTarget:self action:@selector(openDatePicker:) forControlEvents:UIControlEventTouchDown];
/* Disable textfield editing */
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
return NO;
}-(void)openDatePicker:(id)sender {
[[RSDatePickerController sharedInstance] showDatePickerWithDate:nil dateFormat:nil fromView:sender inViewController:self];
}
```### Get Date in specified format
```objective-c
[[RSDatePickerController sharedInstance] showDatePickerWithDate:nil dateFormat:@"MMM dd yyyy" minimumDate:[NSDate date] maximumDate:nil fromView:sender inViewController:self];
``````objective-c
#pragma mark- RSDatePickerDelegate methods- (void)didSelectDate:(NSDate *)date dateString:(NSString *)dateString forView:(id)view {
// Get date and date as string in specified format
}
```## License
RSDatePickerController is released under the MIT license. See LICENSE for details.