diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/disabled.js | 3 | ||||
-rw-r--r-- | examples/hidden.js | 3 | ||||
-rw-r--r-- | examples/pick-time.js | 3 | ||||
-rw-r--r-- | examples/value-and-defaultValue.js | 10 |
4 files changed, 10 insertions, 9 deletions
diff --git a/examples/disabled.js b/examples/disabled.js index 633b8db..4b7c5eb 100644 --- a/examples/disabled.js +++ b/examples/disabled.js | |||
@@ -7,7 +7,6 @@ import ReactDom from 'react-dom'; | |||
7 | 7 | ||
8 | import GregorianCalendar from 'gregorian-calendar'; | 8 | import GregorianCalendar from 'gregorian-calendar'; |
9 | import DateTimeFormat from 'gregorian-calendar-format'; | 9 | import DateTimeFormat from 'gregorian-calendar-format'; |
10 | import zhCn from 'gregorian-calendar/lib/locale/zh_CN'; | ||
11 | 10 | ||
12 | import TimePicker from 'rc-time-picker'; | 11 | import TimePicker from 'rc-time-picker'; |
13 | import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; | 12 | import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; |
@@ -17,7 +16,7 @@ const str = showSecond ? 'HH:mm:ss' : 'HH:mm'; | |||
17 | 16 | ||
18 | const formatter = new DateTimeFormat(str); | 17 | const formatter = new DateTimeFormat(str); |
19 | 18 | ||
20 | const now = new GregorianCalendar(zhCn); | 19 | const now = new GregorianCalendar(TimePickerLocale.calendar); |
21 | now.setTime(Date.now()); | 20 | now.setTime(Date.now()); |
22 | 21 | ||
23 | function generateOptions(length, excludedOptions) { | 22 | function generateOptions(length, excludedOptions) { |
diff --git a/examples/hidden.js b/examples/hidden.js index da366cc..16abd2a 100644 --- a/examples/hidden.js +++ b/examples/hidden.js | |||
@@ -7,7 +7,6 @@ import ReactDom from 'react-dom'; | |||
7 | 7 | ||
8 | import GregorianCalendar from 'gregorian-calendar'; | 8 | import GregorianCalendar from 'gregorian-calendar'; |
9 | import DateTimeFormat from 'gregorian-calendar-format'; | 9 | import DateTimeFormat from 'gregorian-calendar-format'; |
10 | import zhCn from 'gregorian-calendar/lib/locale/zh_CN'; | ||
11 | 10 | ||
12 | import TimePicker from 'rc-time-picker'; | 11 | import TimePicker from 'rc-time-picker'; |
13 | import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; | 12 | import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; |
@@ -17,7 +16,7 @@ const str = showSecond ? 'HH:mm:ss' : 'HH:mm'; | |||
17 | 16 | ||
18 | const formatter = new DateTimeFormat(str); | 17 | const formatter = new DateTimeFormat(str); |
19 | 18 | ||
20 | const now = new GregorianCalendar(zhCn); | 19 | const now = new GregorianCalendar(TimePickerLocale.calendar); |
21 | now.setTime(Date.now()); | 20 | now.setTime(Date.now()); |
22 | 21 | ||
23 | function onChange(value) { | 22 | function onChange(value) { |
diff --git a/examples/pick-time.js b/examples/pick-time.js index dbe1c96..8fa7831 100644 --- a/examples/pick-time.js +++ b/examples/pick-time.js | |||
@@ -7,7 +7,6 @@ import ReactDom from 'react-dom'; | |||
7 | 7 | ||
8 | import GregorianCalendar from 'gregorian-calendar'; | 8 | import GregorianCalendar from 'gregorian-calendar'; |
9 | import DateTimeFormat from 'gregorian-calendar-format'; | 9 | import DateTimeFormat from 'gregorian-calendar-format'; |
10 | import zhCn from 'gregorian-calendar/lib/locale/zh_CN'; | ||
11 | 10 | ||
12 | import TimePicker from 'rc-time-picker'; | 11 | import TimePicker from 'rc-time-picker'; |
13 | import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; | 12 | import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; |
@@ -17,7 +16,7 @@ const str = showSecond ? 'HH:mm:ss' : 'HH:mm'; | |||
17 | 16 | ||
18 | const formatter = new DateTimeFormat(str); | 17 | const formatter = new DateTimeFormat(str); |
19 | 18 | ||
20 | const now = new GregorianCalendar(zhCn); | 19 | const now = new GregorianCalendar(TimePickerLocale.calendar); |
21 | now.setTime(Date.now()); | 20 | now.setTime(Date.now()); |
22 | 21 | ||
23 | function onChange(value) { | 22 | function onChange(value) { |
diff --git a/examples/value-and-defaultValue.js b/examples/value-and-defaultValue.js index 404c963..1be30cc 100644 --- a/examples/value-and-defaultValue.js +++ b/examples/value-and-defaultValue.js | |||
@@ -7,14 +7,12 @@ import ReactDom from 'react-dom'; | |||
7 | 7 | ||
8 | import GregorianCalendar from 'gregorian-calendar'; | 8 | import GregorianCalendar from 'gregorian-calendar'; |
9 | import DateTimeFormat from 'gregorian-calendar-format'; | 9 | import DateTimeFormat from 'gregorian-calendar-format'; |
10 | import zhCn from 'gregorian-calendar/lib/locale/zh_CN'; | ||
11 | |||
12 | import TimePicker from 'rc-time-picker'; | 10 | import TimePicker from 'rc-time-picker'; |
13 | import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; | 11 | import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; |
14 | 12 | ||
15 | const formatter = new DateTimeFormat('HH:mm:ss'); | 13 | const formatter = new DateTimeFormat('HH:mm:ss'); |
16 | 14 | ||
17 | const now = new GregorianCalendar(zhCn); | 15 | const now = new GregorianCalendar(TimePickerLocale.calendar); |
18 | now.setTime(Date.now()); | 16 | now.setTime(Date.now()); |
19 | 17 | ||
20 | const App = React.createClass({ | 18 | const App = React.createClass({ |
@@ -27,6 +25,11 @@ const App = React.createClass({ | |||
27 | console.log(value && formatter.format(value)); | 25 | console.log(value && formatter.format(value)); |
28 | this.setState({ value }); | 26 | this.setState({ value }); |
29 | }, | 27 | }, |
28 | clear() { | ||
29 | this.setState({ | ||
30 | value: undefined, | ||
31 | }); | ||
32 | }, | ||
30 | render() { | 33 | render() { |
31 | return ( | 34 | return ( |
32 | <div> | 35 | <div> |
@@ -35,6 +38,7 @@ const App = React.createClass({ | |||
35 | <TimePicker formatter={formatter} locale={TimePickerLocale} | 38 | <TimePicker formatter={formatter} locale={TimePickerLocale} |
36 | value={this.state.value} | 39 | value={this.state.value} |
37 | onChange={this.handleValueChange}/> | 40 | onChange={this.handleValueChange}/> |
41 | <button onClick={this.clear}>clear</button> | ||
38 | </div> | 42 | </div> |
39 | ); | 43 | ); |
40 | }, | 44 | }, |