html5 datepicker ios,iOS DatePicker日期时间选择器【组件】

日期时间选择,可根据需要设置样式类型:年月日时分、月日时分、年月日、月日、时分,限制最大时间、限制最小时间。

使用:

WSDatePickerView *datepicker = [[WSDatePickerView alloc] initWithDateStyle:DateStyleShowYearMonthDayHourMinute CompleteBlock:^(NSDate *startDate) {

NSString *date = [startDate stringWithFormat:@"yyyy-MM-dd HH:mm"];

NSLog(@"时间: %@",date);

[btn setTitle:date forState:UIControlStateNormal];

}];

datepicker.doneButtonColor = [UIColor purpleColor];//确定按钮的颜色

[datepicker show];

可设置的属性

@property (nonatomic,strong)UIColor *doneButtonColor;//按钮颜色

@property (nonatomic, retain) NSDate *maxLimitDate;//限制最大时间(默认9999-12-31 23:59)

@property (nonatomic, retain) NSDate *minLimitDate;//限制最小时间(默认 0-01-01 00:00)

弹框的类型

typedef enum{

DateStyleShowYearMonthDayHourMinute = 0, //年月日时分

DateStyleShowMonthDayHourMinute, //月日时分

DateStyleShowYearMonthDay, //年月日

DateStyleShowMonthDay, //月日

DateStyleShowHourMinute //时分

}WSDateStyle;

原作GitHub: https://github.com/Zws-China/DatePicker

附上demo:alina_DatePicker_v1.0.1

转载时请注明出处及相应链接,本文永久地址:https://blog.yayuanzi.com/20966.html

75d087ef9a9fb11dc373caaf33adbf7f.png

微信打赏

支付宝打赏

感谢您对作者Alina的打赏,我们会更加努力!    如果您想成为作者,请点我

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值