forked from roycms/RCalendarPicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
127 lines (98 loc) · 6.62 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>Rcalendarpicker by roycms</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="stylesheets/normalize.css" media="screen">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
</head>
<body>
<section class="page-header">
<h1 class="project-name">Rcalendarpicker</h1>
<h2 class="project-tagline">RCalendarPicker 日历控件 ,日历选择控件,日历,日期选择</h2>
<a href="https://github.com/roycms/RCalendarPicker" class="btn">View on GitHub</a>
<a href="https://github.com/roycms/RCalendarPicker/zipball/master" class="btn">Download .zip</a>
<a href="https://github.com/roycms/RCalendarPicker/tarball/master" class="btn">Download .tar.gz</a>
</section>
<section class="main-content">
<h1>
<a id="rcalendarpicker" class="anchor" href="#rcalendarpicker" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>RCalendarPicker</h1>
<p>RCalendarPicker Calendar calendar control, select control, calendar, date selection, the clock selection control. 日历控件 ,日历选择控件,日历,日期选择,时钟选择控件</p>
<h1>
<a id="preview" class="anchor" href="#preview" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Preview</h1>
<p><img src="https://roycms.github.io/RCalendarPicker/RCalendarPicker/Resource/calendar.jpg" alt="预览1">
<img src="https://roycms.github.io/RCalendarPicker/RCalendarPicker/Resource/clock.jpg" alt="预览2"></p>
<h1>
<a id="cocoapods" class="anchor" href="#cocoapods" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>cocoapods</h1>
<pre><code>pod 'RCalendarPicker'
</code></pre>
<h1>
<a id="use" class="anchor" href="#use" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Use</h1>
<p>default: MainScreenWidth = 360 MainScreenHeight = 960</p>
<pre><code> 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];
</code></pre>
<h1>
<a id="the-lunar-calendar" class="anchor" href="#the-lunar-calendar" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>The lunar calendar</h1>
<pre><code>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];
</code></pre>
<h1>
<a id="a-clock-dial-effect" class="anchor" href="#a-clock-dial-effect" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>A clock dial effect</h1>
<pre><code> 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];
</code></pre>
<h1>
<a id="calendar--clock--use" class="anchor" href="#calendar--clock--use" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>calendar + clock use</h1>
<pre><code>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];
};
</code></pre>
<h1>
<a id="todo" class="anchor" href="#todo" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>TODO</h1>
<ul>
<li>增加上下午的判断和参数处理</li>
<li>增加主题定义</li>
<li>增加选择年月的切换形式</li>
</ul>
<footer class="site-footer">
<span class="site-footer-owner"><a href="https://github.com/roycms/RCalendarPicker">Rcalendarpicker</a> is maintained by <a href="https://github.com/roycms">roycms</a>.</span>
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>.</span>
</footer>
</section>
</body>
</html>