Skip to content

Commit 8a0318b

Browse files
committed
Add read me and licence
1 parent 488ff29 commit 8a0318b

3 files changed

Lines changed: 178 additions & 1 deletion

File tree

.npmignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Android/IJ
2+
.idea
3+
.gradle
4+
gradle
5+
build
6+
local.properties
7+
*.iml

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 chymtt
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 150 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,150 @@
1-
https://github.com/prolificinteractive/material-calendarview
1+
# React-native-material-calendarview
2+
3+
A simple material calendar for react native android
4+
5+
## Installation Android
6+
- `npm install --save ...`
7+
8+
- In `android/settings.gradle`
9+
10+
```gradle
11+
...
12+
include ':ReactMaterialCalendarView', ':app'
13+
project(':ReactMaterialCalendarView').projectDir = new File(rootProject.projectDir, '../node_modules/.../app')
14+
```
15+
16+
- In `android/app/build.gradle`
17+
18+
```gradle
19+
...
20+
dependencies {
21+
...
22+
compile project(':ReactMaterialCalendarView')
23+
}
24+
```
25+
26+
- Register module (in MainApplication.java)
27+
28+
```java
29+
import com.nucllear.rn_materialcalendarview.ReactMaterialCalendarViewPackage; // <----- import package
30+
31+
public class MainApplication extends Application implements ReactApplication {
32+
...
33+
34+
@Override
35+
protected List<ReactPackage> getPackages() {
36+
return Arrays.<ReactPackage>asList(
37+
new MainReactPackage(),
38+
new ReactMaterialCalendarViewPackage() // <------ add package here
39+
);
40+
}
41+
}
42+
```
43+
44+
## Usage
45+
46+
```js
47+
48+
import Calendar from '...';
49+
...
50+
51+
render() {
52+
return (
53+
<Calendar
54+
width={(Dimensions.get('window').width)-32}
55+
height={280}
56+
tileHeight={35}
57+
style={{alignSelf: 'center'}}
58+
topbarVisible={true}
59+
datesSelection={'single'}
60+
arrowColor="#DAFACD"
61+
firstDayOfWeek="monday"
62+
currentDate={this.state.today}
63+
selectionColor="#FF3430"
64+
selectedDates={this.state.dates}
65+
weekendsDecorator={true}
66+
eventsDates={["2016/11/20", "2016/11/29"]}
67+
onDateChange={
68+
(data) => {
69+
this.setState({
70+
dates: [data.date]
71+
})
72+
}
73+
}
74+
/>
75+
)
76+
}
77+
```
78+
79+
## Props
80+
81+
* Size
82+
- *Integer* **width** (required)
83+
Provide the width of the calendar.
84+
85+
- *Integer* **height**
86+
Provide the height. Default will be calculated based on width and ```topbarVisible```.
87+
88+
- *Integer* **tileWidth**
89+
Provide the width of one day tile. Set width id DP.
90+
91+
- *Integer* **tileHeight**
92+
Provide the height of one day tile. Set height id DP.
93+
94+
- *Integer* **tileSize**
95+
Provide the size (width and height) of one day tile. Set size id DP.
96+
97+
* Toolbar options
98+
- *boolean* **topbarVisible** (default = true)
99+
Show/hide the top bar which contains the month's title and arrows to go to previous or next months.
100+
101+
- *String* **arrowColor** (format #RRGGBB of #AARRGGBB)
102+
A string color. It changes color of the top bar's arrows.
103+
104+
* Calendar config
105+
- *String* **firstDayOfWeek** (default = 'sunday')
106+
Set the first day of the week.
107+
Should be one of [ ‘monday’, ‘tuesday’, ‘wednesday’, ‘thursday’, ‘friday’, ‘saturday’, ‘sunday’ ]
108+
109+
- *String* **minimumDate** (format 'yyyy/mm/dd')
110+
Set minimum date for calendar.
111+
112+
- *String* **maximumDate** (format 'yyyy/mm/dd')
113+
Set maximum date for calendar.
114+
115+
- *String* **datesSelection**
116+
Set the selection mode.
117+
- *none*: you cannot select date
118+
- *range*: you can select range of dates
119+
- *single*: you can only select one date at a time
120+
- *multiple*: you can select multiple dates
121+
122+
- *String* **showOtherDates** (default = 'current')
123+
Show dates from previous and current months or show dates within current month.
124+
- *all*: dates from previous and current months
125+
- *none*: show dates within current month
126+
127+
* Set date
128+
- *String* **currentDate** (format 'yyyy/mm/dd')
129+
Set the focus of the calendar.
130+
131+
* Color customizations
132+
- *String* **selectionColor** (format #RRGGBB of #AARRGGBB)
133+
Set the color of the selection circle.
134+
- *String* **weekendsColor** (format #RRGGBB of #AARRGGBB)
135+
Set the color of the weekend.
136+
137+
## Event
138+
139+
- onDateChange
140+
Called when user select/deselect a date. The returned data is
141+
```{ date: 'yyyy/mm/dd', selected: boolean }```
142+
- onMonthChanged
143+
Called when user change a month. The returned data is
144+
```{month: int}```
145+
146+
--------------------------------
147+
Feel free to [open an issue](https://github.com/NuclleaR/react-native-material-calendarview/issues).
148+
[Pull requests](https://github.com/NuclleaR/react-native-material-calendarview/pulls) are also welcome
149+
150+
A lot of thanks to @prolificinteractive for their awesome [Material Calendar View](https://github.com/prolificinteractive/material-calendarview)

0 commit comments

Comments
 (0)