-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.android.js
50 lines (44 loc) · 1.07 KB
/
index.android.js
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
/**
* author:徐航
* time:2016年12月13日14:49:52
* blogs:http://www.iloveplus.cn
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import Calendar from './library/components/Calendar';
export default class CalendarDemo extends Component {
constructor(props) {
super(props);
this.state={
selectDates:[],
data:{
month:"2016-12",
data:[{date:"2016-12-11",eventData:[{title:"参加会议",id:"001"}]},
{date:"2016-12-15",eventData:[{title:"准点吃饭",id:"002"}]},
{date:"2016-12-26",eventData:[{title:"参加会议",id:"003"}]}]
}
}
}
_selectDate=(selectDates)=>{
this.setState({selectDates});
};
_onScroll=(month)=>{
alert(month);
this.setState({selectDates:[]});
};
render() {
return (
<Calendar
currentMonthData={this.state.data}
onScroll={this._onScroll}
onPick={this._selectDate}
/>
);
}
}
AppRegistry.registerComponent('calendar', () => CalendarDemo);