From 6fc4e0e8e2f7bd8bbcbb759a69bc7b94930f131c Mon Sep 17 00:00:00 2001 From: yiminghe Date: Thu, 14 Jan 2016 13:59:59 +0800 Subject: remove gregorianCalendarLocale --- src/TimePicker.jsx | 18 ++++-------------- src/locale/en_US.js | 2 ++ src/locale/zh_CN.js | 2 ++ 3 files changed, 8 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index ad4e834..f9b9207 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx @@ -4,7 +4,6 @@ import Panel from './module/Panel'; import placements from './util/placements'; import CommonMixin from './mixin/CommonMixin'; import {getFormatter} from './util/index'; -import defaultGregorianCalendarLocale from 'gregorian-calendar/lib/locale/en_US'; function noop() { } @@ -27,7 +26,6 @@ const Picker = React.createClass({ placement: PropTypes.any, transitionName: PropTypes.string, getPopupContainer: PropTypes.func, - gregorianCalendarLocale: PropTypes.object, placeholder: PropTypes.string, formatter: PropTypes.any, showHour: PropTypes.bool, @@ -50,7 +48,6 @@ const Picker = React.createClass({ defaultOpen: false, style: {}, className: '', - gregorianCalendarLocale: defaultGregorianCalendarLocale, align: {}, allowEmpty: true, showHour: true, @@ -77,7 +74,7 @@ const Picker = React.createClass({ componentWillReceiveProps(nextProps) { const { value, open } = nextProps; - if (value !== undefined) { + if ('value' in nextProps) { this.setState({ value, }); @@ -150,22 +147,15 @@ const Picker = React.createClass({ }, getPanelElement() { - const { prefixCls, defaultValue, locale, placeholder, disabledHours, disabledMinutes, disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showSecond, gregorianCalendarLocale, value } = this.props; - let calendarLocale; - if (value) { - calendarLocale = value.locale; - } else if (defaultValue) { - calendarLocale = defaultValue.locale; - } else { - calendarLocale = gregorianCalendarLocale; - } + const { prefixCls, defaultValue, locale, placeholder, disabledHours, + disabledMinutes, disabledSeconds, hideDisabledOptions, allowEmpty, showHour, showSecond } = this.props; return (