23 | {`class ParentComponent extends Component { 24 | constructor(props) { 25 | super(props); 26 | this.state = { 27 | date: "1990-06-05", 28 | format: "YYYY-MM-DD", 29 | inputFormat: "DD/MM/YYYY", 30 | mode: "date" 31 | }; 32 | } 33 | 34 | handleChange = (newDate) => { 35 | console.log("newDate", newDate); 36 | return this.setState({date: newDate}); 37 | } 38 | 39 | render() { 40 | const {date, format, mode, inputFormat} = this.state; 41 | return51 |; 48 | } 49 | }`} 50 |
{'60 |'}
{'67 |'}
{'76 |'}
{'86 |'}
{'95 | 96 |'}
{'106 | 107 |'}
{'116 |'}
{'125 |'}
78 | 79 | | {moment.months()[this.props.viewDate.month()]} {this.props.viewDate.year()} | 80 | 81 |82 | | ||||
---|---|---|---|---|---|---|
Su | 86 | 87 |Mo | 88 | 89 |Tu | 90 | 91 |We | 92 | 93 |Th | 94 | 95 |Fr | 96 | 97 |Sa | 98 |
01 | 31 | 32 |02 | 33 | 34 |03 | 35 | 36 |04 | 37 |
05 | 41 | 42 |06 | 43 | 44 |07 | 45 | 46 |08 | 47 |
09 | 51 | 52 |10 | 53 | 54 |11 | 55 | 56 |12 | 57 |
13 | 61 | 62 |14 | 63 | 64 |15 | 65 | 66 |16 | 67 |
17 | 71 | 72 |18 | 73 | 74 |19 | 75 | 76 |20 | 77 |
21 | 81 | 82 |22 | 83 | 84 |23 | 85 | 86 |24 | 87 |
00 | 31 | 32 |05 | 33 | 34 |10 | 35 | 36 |15 | 37 |
20 | 41 | 42 |25 | 43 | 44 |30 | 45 | 46 |35 | 47 |
40 | 51 | 52 |45 | 53 | 54 |50 | 55 | 56 |55 | 57 |
‹ | 39 | 40 |{this.props.viewDate.year()} | 41 | 42 |› | 43 |||||
---|---|---|---|---|---|---|
{this.renderMonths()} | 49 |
‹ | 41 | 42 |{year} - {year + 9} | 43 | 44 |› | 45 |||||
---|---|---|---|---|---|---|
{this.renderYears()} | 51 |