TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jul 2016 |
Maintained by harushuu.
With CocoaPods, add this line to your Podfile
.
pod 'SHDatePicker'
and run pod install
, then you're all done!
SHDatePicker *datePicker = [[SHDatePicker alloc] initWithCompleteHandle:^(NSDate *selectedDate, NSString *selectedDateString) {
code...
}];
[datePicker updateHiddenStatus];
A simple date picker. You can custom minute interval and how many days will show.
First init and calculate default datasource only need 95ms. So do not worry about performance DataSource only refresh after time interval
default init
// default dayCount is 7 days;
// default minuteInterval is 5 minutes;
// default firstMinuteInterval is 5 * 60 secend;
- (instancetype)initWithCompleteHandle:(SHDatePickerCompleteHandle)completeHandle;
custom init
- (instancetype)initWithDefaultDayCount:(NSInteger)dayCount
minuteInterval:(NSInteger)minuteInterval
firstMinuteInterval:(NSInteger)firstMinuteInterval
customLanguage:(SHDateLanguageModel *)customLanguage
completeHandle:(SHDatePickerCompleteHandle)completeHandle;
custom your local language
Defualt language will same to your local language (only support english or chinese). but you can custom like yourself. If your language is english or chinese, you will not need setup all property, empty property will auto fill same to your local language.
@interface SHDateLanguageModel : NSObject
@property (nonatomic, strong) NSString *today;
@property (nonatomic, strong) NSString *tomorrow;
@property (nonatomic, strong) NSString *hour;
@property (nonatomic, strong) NSString *minute;
@property (nonatomic, strong) NSString *done;
@property (nonatomic, strong) NSString *cancel;
@harushuu, [email protected]
English: SHDatePicker is available under the MIT license, see the LICENSE file for more information.