{"id":2521,"url":"https://github.com/roycms/RCalendarPicker","last_synced_at":"2025-08-03T00:31:49.201Z","repository":{"id":62451845,"uuid":"73892614","full_name":"roycms/RCalendarPicker","owner":"roycms","description":"RCalendarPicker A date picker control, Calendar calendar control, select control, calendar, date selection, the clock selection control. 日历控件 ，日历选择控件，日历，日期选择，时钟选择控件","archived":false,"fork":false,"pushed_at":"2017-03-01T07:05:20.000Z","size":4576,"stargazers_count":133,"open_issues_count":6,"forks_count":23,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-09T07:48:12.679Z","etag":null,"topics":["calendar","calendar-display","clock","cocoapods"],"latest_commit_sha":null,"homepage":"https://roycms.github.io/RCalendarPicker/","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/roycms.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":"2016-11-16T06:53:33.000Z","updated_at":"2024-07-22T08:14:11.000Z","dependencies_parsed_at":"2022-11-01T23:45:37.754Z","dependency_job_id":null,"html_url":"https://github.com/roycms/RCalendarPicker","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roycms%2FRCalendarPicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roycms%2FRCalendarPicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roycms%2FRCalendarPicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roycms%2FRCalendarPicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roycms","download_url":"https://codeload.github.com/roycms/RCalendarPicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228510715,"owners_count":17931755,"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":["calendar","calendar-display","clock","cocoapods"],"created_at":"2024-01-05T20:16:15.817Z","updated_at":"2024-12-06T18:30:31.481Z","avatar_url":"https://github.com/roycms.png","language":"Objective-C","readme":"![logo](https://roycms.github.io/RCalendarPicker/logo.png)\n# RCalendarPicker\n\nRCalendarPicker Calendar calendar control, select control, calendar, date selection, the clock selection control. 日历控件 ，日历选择控件，日历，日期选择，时钟选择控件\n\n[![CocoaPods](https://img.shields.io/badge/pod-0.0.1-red.svg)](http://cocoapods.org/?q=RCalendarPicker)\n[![Packagist](https://img.shields.io/packagist/l/doctrine/orm.svg?maxAge=2592000?style=flat-square)](https://github.com/roycms/RCalendarPicker/blob/master/LICENSE)\n[![email](https://img.shields.io/badge/%20email%20-%20roycms%40qq.com%20-yellowgreen.svg)](mailto:roycms@qq.com)\n[![doc](https://img.shields.io/badge/%E4%B8%AD%E6%96%87-DOC-orange.svg)](https://github.com/roycms/)\n\n\n# Preview\n\n![预览1](https://roycms.github.io/RCalendarPicker/RCalendarPicker/Resource/calendar.jpg)\n![预览1](https://roycms.github.io/RCalendarPicker/RCalendarPicker/Resource/clock.jpg)\n# cocoapods\n\u003e Pod installation failure  Please have a look at issues2 https://github.com/roycms/RCalendarPicker/issues/2\n\n```\npod 'RCalendarPicker'\n---or---\npod 'RCalendarPicker', :git =\u003e 'https://github.com/roycms/RCalendarPicker.git'\n```\n# Run\n\n```\ncd myfinder\ngit clone https://github.com/roycms/RCalendarPicker.git\ncd RCalendarPicker\nrun pod install\nxcode open RCalendarPicker.xcworkspace\n```\n\n# Use Introduce file\n\nIntroduce the head file\n```objective-c\n#import \"RCalendarPickerView.h\" // The calendar\n#import \"RClockPickerView.h\" // A clock dial effect\n#import \"DateHelper.h\" // Time processing with the help of the class\n```\n\n# calendar\n\ndefault: MainScreenWidth = 360  MainScreenHeight = 960\n```objective-c\n RCalendarPickerView *calendarPicker = [[RCalendarPickerView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight)];\n            calendarPicker.selectDate = [NSDate date]; //默认被选中时间\n            calendarPicker.complete = ^(NSInteger day, NSInteger month, NSInteger year, NSDate *date){\n                NSLog(@\"%d-%d-%d\", (int)year,(int)month,(int)day);\n            };\n            [self.view addSubview:calendarPicker];\n```\n\n# The lunar calendar\nCalendar lunar display forms\n```objective-c\nRCalendarPickerView *calendarPicker = [[RCalendarPickerView alloc]init];\ncalendarPicker.isLunarCalendar = YES; //开启农历\n\n```\n\n# The calendar dataSource\n\nThe days in the calendar display when binding event data\n\n![dataSource预览](https://roycms.github.io/RCalendarPicker/RCalendarPicker/Resource/dataSource.png)\n\n```objective-c\nRCalendarPickerView *calendarPicker = [[RCalendarPickerView alloc]init];\ncalendarPicker.dataSource = self.dataSource;\n```\n\nself.dataSource is test data  for json file\n```json\n[{\"date\":\"2016-12-1\",\"value\":1},\n{\"date\":\"2016-12-3\",\"value\":1},\n{\"date\":\"2016-12-7\",\"value\":1},\n{\"date\":\"2016-12-19\",\"value\":1},\n{\"date\":\"2016-12-29\",\"value\":1}]\n```\n\n# calendar Theme\nSet the calendar theme colors\n\n```objective-c\nRCalendarPickerView *calendarPicker = [[RCalendarPickerView alloc]init];\ncalendarPicker.thisTheme =[UIColor blackColor]; //设置主题颜色 缺省情况下随机显示\n```\n\n# A clock dial effect\nThe effect of a similar watches and clocks, can drag pointer to set a time\n\n```objective-c\n RClockPickerView *rClockPickerView = [[RClockPickerView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight)\n                                                                            clockRadius:140\n                                                                 clockCalibrationRadius:130];\n            rClockPickerView.date = [NSDate date];\n            rClockPickerView.complete = ^(NSInteger hours, NSInteger minutes, NSInteger noon,float clockDate){\n                NSLog(@\"%d-%d-%d   float clockDate:  -%f\", (int)hours,(int)minutes,(int)noon,clockDate);\n\n            };\n            [self.view addSubview:rClockPickerView];\n```\n\n# calendar + clock  use\n\nTo choose the calendar (date) (month) (year) and the vehicle to choose the combination use of the clock\n\n```objective-c\nRCalendarPickerView *calendarPicker = [[RCalendarPickerView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight)];\n            calendarPicker.selectDate = [NSDate date]; //默认被选中时间\n            [self.view addSubview:calendarPicker];\n\n            calendarPicker.complete = ^(NSInteger day, NSInteger month, NSInteger year, NSDate *date){\n                NSLog(@\"%d-%d-%d\", (int)year,(int)month,(int)day);\n\n                RClockPickerView *rClockPickerView = [[RClockPickerView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight)\n                                                                                clockRadius:140\n                                                                     clockCalibrationRadius:130];\n                rClockPickerView.date = [NSDate date];\n                rClockPickerView.complete = ^(NSInteger hours, NSInteger minutes, NSInteger noon,float clockDate){\n                    NSLog(@\"%d-%d-%d\", (int)hours,(int)minutes,(int)noon);\n\n                    NSDate *selectDate = [DateHelper dateInDate:date Hours:hours minutes:minutes];\n\n                    NSLog(@\"selectDate: %@\",selectDate);\n\n                };\n                [self.view addSubview:rClockPickerView];\n            };\n\n```\n# pop-up window Gestures conflict bug   \nIn the current UIView sliding gesture of conflicts between the pop-up window will open bugs can be directly in the new UIViewController   \n```objective-c\n            UIViewController *viewController = [[UIViewController alloc]init];\n            \n            RCalendarPickerView *calendarPicker = [[RCalendarPickerView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight)];\n            calendarPicker.selectDate = [NSDate date]; //默认被选中时间\n            [viewController.view addSubview:calendarPicker];\n            calendarPicker.complete = ^(NSInteger day, NSInteger month, NSInteger year, NSDate *date){\n                NSLog(@\"%d-%d-%d\", (int)year,(int)month,(int)day);\n                  [self.navigationController popViewControllerAnimated:YES];\n            };\n            [self.navigationController pushViewController:viewController animated:YES];\n```\n\n# TODO\n\n* [x] 增加选择年月的切换形式\n* [x] 定义日期的可选择范围\n* [x] Tests\n\n# You may encounter problems   \n\u003e[NSDate 8小时问题-没你想的那么简单！](http://www.jianshu.com/p/df41659b06a9)\n\n","funding_links":[],"categories":["UI"],"sub_categories":["Calendar","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froycms%2FRCalendarPicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froycms%2FRCalendarPicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froycms%2FRCalendarPicker/lists"}