diff options
Diffstat (limited to 'src/mixin')
-rw-r--r-- | src/mixin/CommonMixin.js | 30 |
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 @@ | |||
1 | import {PropTypes} from 'react'; | 1 | import {PropTypes} from 'react'; |
2 | import enUs from '../locale/en_US'; | 2 | import enUs from '../locale/en_US'; |
3 | import {getFormatter} from '../util/index'; | ||
4 | 3 | ||
5 | export default { | 4 | export 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 | }; |