# RCalendarPicker **Repository Path**: key/RCalendarPicker ## Basic Information - **Project Name**: RCalendarPicker - **Description**: RCalendarPicker 日历控件 ,日历选择控件,日历,日期选择 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 11 - **Created**: 2016-11-28 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ![logo](https://roycms.github.io/RCalendarPicker/logo.png) # RCalendarPicker RCalendarPicker Calendar calendar control, select control, calendar, date selection, the clock selection control. 日历控件 ,日历选择控件,日历,日期选择,时钟选择控件 [![CocoaPods](https://img.shields.io/badge/pod-0.0.1-red.svg)](http://cocoapods.org/?q=RCalendarPicker) [![Packagist](https://img.shields.io/packagist/l/doctrine/orm.svg?maxAge=2592000?style=flat-square)](https://github.com/roycms/RCalendarPicker/blob/master/LICENSE) [![email](https://img.shields.io/badge/%20email%20-%20roycms%40qq.com%20-yellowgreen.svg)](mailto:roycms@qq.com) [![doc](https://img.shields.io/badge/%E4%B8%AD%E6%96%87-DOC-orange.svg)](https://github.com/roycms/) # Preview ![预览1](https://roycms.github.io/RCalendarPicker/RCalendarPicker/Resource/calendar.jpg) ![预览2](https://roycms.github.io/RCalendarPicker/RCalendarPicker/Resource/clock.jpg) # cocoapods ``` pod 'RCalendarPicker' ``` # Use Introduce the head file ``` #import "RCalendarPickerView.h" // The lunar calendar #import "RClockPickerView.h" // A clock dial effect #import "DateHelper.h" // Time processing with the help of the class ``` # calendar default: MainScreenWidth = 360 MainScreenHeight = 960 ``` RCalendarPickerView *calendarPicker = [[RCalendarPickerView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight)]; calendarPicker.today = [NSDate date]; //现在时间 calendarPicker.date = calendarPicker.today; //选择时间 calendarPicker.complete = ^(NSInteger day, NSInteger month, NSInteger year, NSDate *date){ NSLog(@"%d-%d-%d", (int)year,(int)month,(int)day); }; [self.view addSubview:calendarPicker]; ``` # The lunar calendar ``` RCalendarPickerView *calendarPicker = [[RCalendarPickerView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight)]; calendarPicker.isZn = YES; //开启农历 calendarPicker.today = [NSDate date]; //现在时间 calendarPicker.date = calendarPicker.today; //选择时间 calendarPicker.complete = ^(NSInteger day, NSInteger month, NSInteger year, NSDate *date){ NSLog(@"%d-%d-%d", (int)year,(int)month,(int)day); }; [self.view addSubview:calendarPicker]; ``` # A clock dial effect ``` RClockPickerView *rClockPickerView = [[RClockPickerView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight) clockRadius:140 clockCalibrationRadius:130]; rClockPickerView.date = [NSDate date]; rClockPickerView.complete = ^(NSInteger hours, NSInteger minutes, NSInteger noon){ NSLog(@"%d-%d-%d", (int)hours,(int)minutes,(int)noon); }; [self.view addSubview:rClockPickerView]; ``` # calendar + clock use ``` RCalendarPickerView *calendarPicker = [[RCalendarPickerView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight)]; calendarPicker.today = [NSDate date]; //现在时间 calendarPicker.date = calendarPicker.today; //选择时间 [self.view addSubview:calendarPicker]; calendarPicker.complete = ^(NSInteger day, NSInteger month, NSInteger year, NSDate *date){ NSLog(@"%d-%d-%d", (int)year,(int)month,(int)day); RClockPickerView *rClockPickerView = [[RClockPickerView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight) clockRadius:140 clockCalibrationRadius:130]; rClockPickerView.date = [NSDate date]; rClockPickerView.complete = ^(NSInteger hours, NSInteger minutes, NSInteger noon){ NSLog(@"%d-%d-%d", (int)hours,(int)minutes,(int)noon); NSDate *selectDate = [DateHelper dateInDate:date Hours:hours>12?hours%12:hours minutes:minutes]; NSLog(@"selectDate: %@",selectDate); }; [self.view addSubview:rClockPickerView]; }; ``` # TODO * 增加上下午的判断和参数处理 * 增加主题定义 * 增加选择年月的切换形式