From 4984ed85e54f442998a335db70618d6184fa397e Mon Sep 17 00:00:00 2001 From: yiminghe Date: Thu, 4 Aug 2016 19:53:55 +0800 Subject: 2.x :boom: --- examples/disabled.js | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'examples/disabled.js') diff --git a/examples/disabled.js b/examples/disabled.js index b650448..9d74002 100644 --- a/examples/disabled.js +++ b/examples/disabled.js @@ -5,19 +5,14 @@ import 'rc-time-picker/assets/index.less'; import React from 'react'; import ReactDom from 'react-dom'; -import GregorianCalendar from 'gregorian-calendar'; -import DateTimeFormat from 'gregorian-calendar-format'; +import moment from 'moment'; import TimePicker from 'rc-time-picker'; -import TimePickerLocale from 'rc-time-picker/src/locale/zh_CN'; const showSecond = true; const str = showSecond ? 'HH:mm:ss' : 'HH:mm'; -const formatter = new DateTimeFormat(str); - -const now = new GregorianCalendar(TimePickerLocale.calendar); -now.setTime(Date.now()); +const now = moment().hour(14).minute(30); function generateOptions(length, excludedOptions) { const arr = []; @@ -30,7 +25,7 @@ function generateOptions(length, excludedOptions) { } function onChange(value) { - console.log(value && formatter.format(value)); + console.log(value && value.format(str)); } function disabledHours() { @@ -53,13 +48,14 @@ function disabledSeconds(h, m) { } ReactDom.render( - , + , document.getElementById('__react-content') ); -- cgit v1.2.3