forked from stephy/CalendarPicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ios.js
66 lines (55 loc) · 1.51 KB
/
index.ios.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
*
* Copyright 2016 Yahoo Inc.
* Licensed under the terms of the MIT license. See LICENSE file in the project root for terms.
*/
'use strict';
import React from 'react';
import {
AppRegistry,
Dimensions,
StyleSheet,
Text,
View
} from 'react-native';
var CalendarPicker = require('./CalendarPicker/CalendarPicker'),
CalendarPicker2;
CalendarPicker2 = React.createClass({
getInitialState: function() {
return {
date: new Date()
};
},
onDateChange: function(date) {
this.setState({ date: date });
},
render: function() {
return (
<View style={styles.container}>
<CalendarPicker
selectedDate={this.state.date}
onDateChange={this.onDateChange}
screenWidth={Dimensions.width}
weekdays = {['Mon', 'Tue', 'Wed', 'Th', 'Fri', 'Sat', 'Sun']}
months = {['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']}
nextTitle={'Next'}
previousTitle={'Previous'}
startFromMonday={true}
selectedDayColor={'#E12518'}
selectedDayTextColor={'#FFFFFF'}
style={{}} />
<Text style={styles.selectedDate}> Date: { this.state.date.toString() } </Text>
</View>
);
}
});
const styles = StyleSheet.create({
container: {
marginTop: 30
},
selectedDate: {
backgroundColor: 'rgba(0,0,0,0)',
color: '#000'
}
});
AppRegistry.registerComponent('CalendarPicker2', () => CalendarPicker2);