{"id":21374056,"url":"https://github.com/CXTretar/CXDatePickerView","last_synced_at":"2025-07-13T08:32:14.675Z","repository":{"id":56905325,"uuid":"138985930","full_name":"CXTretar/CXDatePickerView","owner":"CXTretar","description":"一个自定义的日期时间选择器","archived":false,"fork":false,"pushed_at":"2021-01-17T01:36:58.000Z","size":654,"stargazers_count":64,"open_issues_count":6,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-14T17:00:03.702Z","etag":null,"topics":["date","datepickerview","pickerview","pod"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CXTretar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-28T07:59:21.000Z","updated_at":"2024-10-17T03:04:06.000Z","dependencies_parsed_at":"2022-08-20T19:20:26.713Z","dependency_job_id":null,"html_url":"https://github.com/CXTretar/CXDatePickerView","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CXTretar%2FCXDatePickerView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CXTretar%2FCXDatePickerView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CXTretar%2FCXDatePickerView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CXTretar%2FCXDatePickerView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CXTretar","download_url":"https://codeload.github.com/CXTretar/CXDatePickerView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225868608,"owners_count":17537084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["date","datepickerview","pickerview","pod"],"created_at":"2024-11-22T08:29:39.819Z","updated_at":"2024-11-22T08:30:09.977Z","avatar_url":"https://github.com/CXTretar.png","language":"Objective-C","funding_links":[],"categories":["OOM-Leaks-Crash"],"sub_categories":["Picker"],"readme":"# CXDatePickerView\n\n\u003cdiv\u003e\n\u003cimg src=\"https://github.com/CXTretar/CXDatePickerView/blob/master/screenshots/version_0.2.5.1.png\" hspace=\"10\" width = \"414\" height = \"896\" alt=\"\" align=center /\u003e\n\u003cimg src=\"https://github.com/CXTretar/CXDatePickerView/blob/master/screenshots/version_0.2.5.2.png\" hspace=\"10\" width = \"414\" height = \"896\" alt=\"\" align=center /\u003e\n\u003c/div\u003e\n\n# Update【更新】\nversion: 0.2.5\n- 修复iOS 14 闪退Bug。\n- 增加了选中日期的字体和颜色自定义功能。\n- 增加了日期单位的三种显示风格。\n- 修复了日期单位文本的字体和颜色自定义功能。\n\n# Install【安装】\n在Podfile文件中添加` pod 'CXDatePickerView', '~\u003e 0.2.2'`，并运行 `pod install`\n# Usage【使用】\n* import【导入框架】\n`#import \"CXDatePickerView.h\"`\n\n* init【创建选择器】\n```\n/**\n 默认滚动到当前时间\n */\n- (instancetype)initWithDateStyle:(CXDatePickerStyle)datePickerStyle completeBlock:(void(^)(NSDate *date))completeBlock;\n\n\n/**\n 滚动到指定的的日期\n */\n- (instancetype)initWithDateStyle:(CXDatePickerStyle)datePickerStyle scrollToDate:(NSDate *)scrollToDate completeBlock:(void(^)(NSDate *date))completeBlock;\n\n\n/**\n  定制天时分选择器\n */\n- (instancetype)initWithZeroDayCompleteBlock:(void(^)(NSInteger days,NSInteger hours,NSInteger minutes))completeBlock;\n```\n* style【选择器样式】\n\n```  \n/**\n *  弹出日期类型\n */\ntypedef NS_ENUM(NSUInteger, CXDatePickerStyle) {\n    CXDateYearMonthDayHourMinuteSecond = 0, //年月日时分秒\n    CXDateYearMonthDayHourMinute,           //年月日时分\n    CXDateMonthDayHourMinute,               //月日时分\n    CXDateYearMonthDay,                     //年月日\n    CXDateDayHourMinute,                    //日时分\n    CXDateYearMonth,                        //年月\n    CXDateMonthDay,                         //月日\n    CXDateHourMinuteSecond,                 //时分秒\n    CXDateHourMinute                        //时分\n};\n\n/**\n *  弹出日期单位显示类型\n */\ntypedef NS_ENUM(NSUInteger, CXDateLabelUnitStyle) {\n    CXDateLabelUnitFixed = 0,              // 添加固定位置的日期单位\n    CXDateLabelTextAllUnit,                // 添加所有日期的日期单位\n    CXDateLabelTextSelectUnit,             // 添加选中日期的日期单位\n};\n\n```\n* custom【自定义属性】\n```\n/**\n *  日期单位样式\n */\n@property (nonatomic, assign) CXDateLabelUnitStyle dateLabelUnitStyle; // 默认0.25\n\n/**\n *  弹出动画时间\n */\n@property (nonatomic, assign) CGFloat showAnimationTime; // 默认0.25\n\n/**\n *  展示时背景透明度\n */\n@property (nonatomic, assign) CGFloat shadeViewAlphaWhenShow; //默认0.5\n\n/**\n *  头部视图背景颜色\n */\n@property (nonatomic, strong) UIColor *headerViewColor; // 默认白色\n/**\n *  头部标题颜色\n */\n@property (nonatomic, strong) UIColor *headerTitleColor;\n/**\n *  头部标题文字\n */\n@property (nonatomic, copy) NSString *headerTitle;\n/**\n *  头部标题字体\n */\n@property (nonatomic, strong) UIFont *headerTitleFont;\n/**\n *  确定按钮颜色\n */\n@property (nonatomic, strong) UIColor *doneButtonColor;\n/**\n *  确定按钮文字\n */\n@property (nonatomic, copy) NSString *doneButtonTitle;\n/**\n *  确定按钮字体\n */\n@property (nonatomic, strong) UIFont *doneButtonFont;\n/**\n *  取消按钮颜色\n */\n@property (nonatomic, strong) UIColor *cancelButtonColor;\n/**\n *  取消按钮文字\n */\n@property (nonatomic, copy) NSString *cancelButtonTitle;\n/**\n *  取消按钮字体\n */\n@property (nonatomic, strong) UIFont *cancelButtonFont;\n\n/**\n *  年-月-日-时-分 单位文字颜色(默认橙色)\n */\n@property (nonatomic, strong) UIColor *dateUnitLabelColor;\n/**\n *  年-月-日-时-分 单位文字字体(默认 [UIFont systemFontOfSize:15])\n */\n@property (nonatomic, strong) UIFont *dateUnitLabelFont;\n/**\n *  滚轮日期选中颜色(默认橙色)\n */\n@property (nonatomic, strong) UIColor *datePickerSelectColor;\n/**\n *  滚轮日期选中字体\n */\n@property (nonatomic, strong) UIFont *datePickerSelectFont;\n/**\n *  滚轮日期颜色(默认黑色)\n */\n@property (nonatomic, strong) UIColor *datePickerColor;\n/**\n *  滚轮日期字体\n */\n@property (nonatomic, strong) UIFont *datePickerFont;\n/**\n *  限制最大时间（默认2099）datePicker大于最大日期则滚动回最大限制日期\n */\n@property (nonatomic, strong) NSDate *maxLimitDate;\n/**\n *  限制最小时间（默认0） datePicker小于最小日期则滚动回最小限制日期\n */\n@property (nonatomic, strong) NSDate *minLimitDate;\n\n/**\n *  大号年份字体颜色(默认灰色)想隐藏可以设置为clearColor\n */\n@property (nonatomic, strong) UIColor *yearLabelColor;\n\n/**\n *  隐藏每行年月日文字\n */\n@property (nonatomic, assign) BOOL hideDateNameLabel;\n\n/**\n *  隐藏每行分割线\n */\n@property (nonatomic, assign) BOOL hideSegmentedLine;\n\n/**\n *  隐藏背景年份文字\n */\n@property (nonatomic, assign) BOOL hideBackgroundYearLabel;\n\n/**\n *  头部按钮视图高度\n */\n@property (nonatomic, assign) CGFloat topViewHeight; // 默认44\n\n/**\n *  选择器部分视图高度\n */\n@property (nonatomic, assign) CGFloat pickerViewHeight; // 默认200\n\n\n/**\n *  选择器每行高度\n */\n@property (nonatomic, assign) CGFloat pickerRowHeight; // 默认44\n\n```\n* example【示例】 \n```\n#pragma mark - 年-月-日-时-分-秒\n- (void)showYearMonthDayHourMinuteSecond:(NSIndexPath *)indexPath {\n    CXDatePickerView *datepicker = [[CXDatePickerView alloc] initWithDateStyle:CXDateYearMonthDayHourMinuteSecond completeBlock:^(NSDate *selectDate) {\n        \n        NSString *dateString = [selectDate cx_stringWithFormat:@\"yyyy-MM-dd HH:mm:ss\"];\n        NSLog(@\"选择的日期：%@\",dateString);\n        self.examples[indexPath.row].title = dateString;\n        [self.tableView reloadData];\n    }];\n    datepicker.dateUnitLabelColor = [UIColor orangeColor];//年-月-日-时-分-秒 颜色\n    datepicker.datePickerColor = [UIColor blackColor];//滚轮日期颜色\n    datepicker.headerViewColor = [UIColor orangeColor]; // 顶部视图背景颜色\n    datepicker.doneButtonColor = [UIColor whiteColor]; // 确认按钮字体颜色\n    datepicker.cancelButtonColor = [UIColor whiteColor]; // 取消按钮颜色\n    datepicker.shadeViewAlphaWhenShow = 0.25;\n    datepicker.headerTitle = @\"选择日期\";\n    datepicker.headerTitleColor = [UIColor whiteColor];\n    datepicker.minLimitDate = [NSDate cx_date:@\"2019-12-1 12:45:00\" WithFormat:@\"yyyy-MM-dd HH:mm:ss\"];\n    datepicker.maxLimitDate = [NSDate cx_date:@\"2022-12-26 12:45:00\" WithFormat:@\"yyyy-MM-dd HH:mm:ss\"];\n    datepicker.datePickerSelectColor = [UIColor orangeColor];\n    datepicker.datePickerSelectFont = [UIFont systemFontOfSize:17];\n    [datepicker show];\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCXTretar%2FCXDatePickerView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCXTretar%2FCXDatePickerView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCXTretar%2FCXDatePickerView/lists"}