aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/mixin
diff options
context:
space:
mode:
authoryiminghe <yiminghe@gmail.com>2015-11-27 16:15:05 +0800
committeryiminghe <yiminghe@gmail.com>2015-11-27 16:15:05 +0800
commit8133e8cf3b37b2be764616493ade7c7a7678fce1 (patch)
tree4321352889ab62f18ff8703adac8756ddb506dc0 /src/mixin
parent7702bb67968104a64fa85ba7e893bf2393eeb3c5 (diff)
downloadtime-picker-8133e8cf3b37b2be764616493ade7c7a7678fce1.tar.gz
time-picker-8133e8cf3b37b2be764616493ade7c7a7678fce1.tar.zst
time-picker-8133e8cf3b37b2be764616493ade7c7a7678fce1.zip
add gregorianCalendarLocale prop1.0.0-alpha1
Diffstat (limited to 'src/mixin')
-rw-r--r--src/mixin/CommonMixin.js30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/mixin/CommonMixin.js b/src/mixin/CommonMixin.js
index 0e8ed32..a6893b8 100644
--- a/src/mixin/CommonMixin.js
+++ b/src/mixin/CommonMixin.js
@@ -1,6 +1,5 @@
1import {PropTypes} from 'react'; 1import {PropTypes} from 'react';
2import enUs from '../locale/en_US'; 2import enUs from '../locale/en_US';
3import {getFormatter} from '../util/index';
4 3
5export default { 4export default {
6 propTypes: { 5 propTypes: {
@@ -14,33 +13,4 @@ export default {
14 locale: enUs, 13 locale: enUs,
15 }; 14 };
16 }, 15 },
17
18 getFormatter() {
19 const formatter = this.props.formatter;
20 const locale = this.props.locale;
21 if (formatter) {
22 if (formatter === this.lastFormatter) {
23 return this.normalFormatter;
24 }
25 this.normalFormatter = getFormatter(formatter, locale);
26 this.lastFormatter = formatter;
27 return this.normalFormatter;
28 }
29 if (!this.showSecond) {
30 if (!this.notShowSecondFormatter) {
31 this.notShowSecondFormatter = getFormatter('HH:mm', locale);
32 }
33 return this.notShowSecondFormatter;
34 }
35 if (!this.showHour) {
36 if (!this.notShowHourFormatter) {
37 this.notShowHourFormatter = getFormatter('mm:ss', locale);
38 }
39 return this.notShowHourFormatter;
40 }
41 if (!this.normalFormatter) {
42 this.normalFormatter = getFormatter('HH:mm:ss', locale);
43 }
44 return this.normalFormatter;
45 },
46}; 16};