File tree Expand file tree Collapse file tree 3 files changed +689
-23
lines changed Expand file tree Collapse file tree 3 files changed +689
-23
lines changed Original file line number Diff line number Diff line change 1
- import React , { Component } from ' react'
1
+ import React , { Component } from " react" ;
2
2
3
- import ExampleComponent from ' react-range-calendar'
3
+ import Calendar from " react-range-calendar" ;
4
4
5
5
export default class App extends Component {
6
- render ( ) {
6
+ state = {
7
+ visible : true ,
8
+ startWithDates : [ new Date ( ) , new Date ( "21/5/2019" ) ]
9
+ } ;
10
+ render ( ) {
11
+ const { visible, startWithDates } = this . state ;
12
+ const step = 7 ;
13
+ const startWith = "Wed" ;
7
14
return (
8
- < div >
9
- < ExampleComponent text = 'Modern React component module' />
15
+ < div className = "App" >
16
+ < button onClick = { ( ) => this . setState ( { visible : ! visible } ) } >
17
+ Toggle Calendar
18
+ </ button >
19
+ < div style = { { display : "flex" , justifyContent : "center" } } >
20
+ < Calendar
21
+ visible = { visible }
22
+ // date={date}
23
+ step = { step }
24
+ startWith = { startWith }
25
+ startWithDates = { startWithDates }
26
+ onDayClick = { ( minDate , maxDate ) => {
27
+ this . setState ( { startWithDates : [ minDate , maxDate ] } ) ;
28
+ } }
29
+ // baseColor="red"
30
+ // fontColor="yellow"
31
+ // hoverBackgroundColor="brown"
32
+ // hoverFontColor="black"
33
+ // disabledColor="orange"
34
+ // weekDaysColor="green"
35
+ // weekendsDaysColor="black"
36
+ type = "fix-range"
37
+ />
38
+ </ div >
10
39
</ div >
11
- )
40
+ ) ;
12
41
}
13
42
}
You can’t perform that action at this time.
0 commit comments