forked from inno-v/react-date-picker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.jsx
72 lines (56 loc) · 1.56 KB
/
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
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
67
68
69
70
71
72
'use strict'
require('./base.css')
require('./theme/hackerone.css')
var moment = require('moment');
var React = require('react')
var DatePicker = require('./src/index')
var VALUE = Date.now()
var LOCALE = 'en'
var TODAY = {
en: 'Today',
fr: 'Aujourd\'hui',
de: 'Heute',
es: 'Hoy',
ro: 'Azi'
}
var GO2SELECTED = {
en: 'Go to selected',
es: 'Vaya a Favoritos',
de: 'Zum ausgewählten',
fr: 'Aller a la liste',
ro: 'Mergi la selectie'
}
function emptyFn(){}
console.log('test')
var App = React.createClass({
displayName: 'App',
onLocaleChange: function(event) {
LOCALE = event.target.value
this.setState({})
},
render: function(){
return <div style={{margin: 10}}>
<p>Select locale: <select value={LOCALE} onChange={this.onLocaleChange}>
<option value="en">English (US)</option>
<option value="fr">French</option>
<option value="de">German</option>
<option value="es">Spanish</option>
<option value="ro">Romanian</option>
</select>
</p>
<DatePicker
style={{width: 250, height: 300}}
minDate={moment()}
locale={LOCALE}
date={VALUE}
onChange={this.onChange}
/>
</div>
},
onChange: function(value) {
console.log('selected ', value)
VALUE = value
this.setState({})
}
})
React.render(<App />, document.getElementById('content'))