From 6fc4e0e8e2f7bd8bbcbb759a69bc7b94930f131c Mon Sep 17 00:00:00 2001 From: yiminghe Date: Thu, 14 Jan 2016 13:59:59 +0800 Subject: remove gregorianCalendarLocale --- examples/disabled.js | 3 +-- examples/hidden.js | 3 +-- examples/pick-time.js | 3 +-- examples/value-and-defaultValue.js | 10 +++++++--- 4 files changed, 10 insertions(+), 9 deletions(-) (limited to 'examples') 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'; import GregorianCalendar from 'gregorian-calendar'; import DateTimeFormat from 'gregorian-calendar-format'; -import zhCn from 'gregorian-calendar/lib/locale/zh_CN'; import TimePicker from 'rc-time-picker'; import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; @@ -17,7 +16,7 @@ const str = showSecond ? 'HH:mm:ss' : 'HH:mm'; const formatter = new DateTimeFormat(str); -const now = new GregorianCalendar(zhCn); +const now = new GregorianCalendar(TimePickerLocale.calendar); now.setTime(Date.now()); 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'; import GregorianCalendar from 'gregorian-calendar'; import DateTimeFormat from 'gregorian-calendar-format'; -import zhCn from 'gregorian-calendar/lib/locale/zh_CN'; import TimePicker from 'rc-time-picker'; import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; @@ -17,7 +16,7 @@ const str = showSecond ? 'HH:mm:ss' : 'HH:mm'; const formatter = new DateTimeFormat(str); -const now = new GregorianCalendar(zhCn); +const now = new GregorianCalendar(TimePickerLocale.calendar); now.setTime(Date.now()); 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'; import GregorianCalendar from 'gregorian-calendar'; import DateTimeFormat from 'gregorian-calendar-format'; -import zhCn from 'gregorian-calendar/lib/locale/zh_CN'; import TimePicker from 'rc-time-picker'; import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; @@ -17,7 +16,7 @@ const str = showSecond ? 'HH:mm:ss' : 'HH:mm'; const formatter = new DateTimeFormat(str); -const now = new GregorianCalendar(zhCn); +const now = new GregorianCalendar(TimePickerLocale.calendar); now.setTime(Date.now()); 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'; import GregorianCalendar from 'gregorian-calendar'; import DateTimeFormat from 'gregorian-calendar-format'; -import zhCn from 'gregorian-calendar/lib/locale/zh_CN'; - import TimePicker from 'rc-time-picker'; import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; const formatter = new DateTimeFormat('HH:mm:ss'); -const now = new GregorianCalendar(zhCn); +const now = new GregorianCalendar(TimePickerLocale.calendar); now.setTime(Date.now()); const App = React.createClass({ @@ -27,6 +25,11 @@ const App = React.createClass({ console.log(value && formatter.format(value)); this.setState({ value }); }, + clear() { + this.setState({ + value: undefined, + }); + }, render() { return (
@@ -35,6 +38,7 @@ const App = React.createClass({ +
); }, -- cgit v1.2.3