-
Notifications
You must be signed in to change notification settings - Fork 106
/
Copy pathindex.jsx
34 lines (24 loc) · 794 Bytes
/
index.jsx
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
'use strict'
require('./index.styl')
var React = require('react')
var DatePicker = require('./src/index')
var DATE = Date.now()
var VALUE
var App = React.createClass({
displayName: 'App',
render: function(){
var v = VALUE || Date.now()
return <div style={{margin: 10}}>
<DatePicker minDate='2014-04-04' maxDate='2015-10-10' date={v} hideFooter={true} viewDate={DATE} onChange={this.onChange}/></div>
},
onChange: function(date, dateString) {
DATE = dateString
VALUE = dateString
this.setState({})
}
})
if (React.createFactory){
DatePicker = React.createFactory(DatePicker)
App = React.createFactory(App)
}
;(React.render || React.renderComponent)(<App />, document.getElementById('content'))