@zohodesk/i18n 1.0.0-beta.3 → 1.0.0-beta.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +120 -2
  2. package/es/I18NContext.js +1 -2
  3. package/es/components/DateTimeDiffFormat.js +192 -200
  4. package/es/components/FormatText.js +4 -25
  5. package/es/components/HOCI18N.js +33 -45
  6. package/es/components/I18N.js +48 -63
  7. package/es/components/I18NProvider.js +60 -85
  8. package/es/components/PluralFormat.js +29 -48
  9. package/es/components/UserTimeDiffFormat.js +65 -74
  10. package/es/components/__tests__/DateTimeDiffFormat.spec.js +868 -657
  11. package/es/components/__tests__/FormatText.spec.js +20 -17
  12. package/es/components/__tests__/HOCI18N.spec.js +18 -22
  13. package/es/components/__tests__/I18N.spec.js +20 -19
  14. package/es/components/__tests__/I18NProvider.spec.js +36 -45
  15. package/es/components/__tests__/PluralFormat.spec.js +20 -17
  16. package/es/components/__tests__/UserTimeDiffFormat.spec.js +1343 -1095
  17. package/es/index.js +2 -6
  18. package/es/utils/__tests__/jsxTranslations.spec.js +174 -0
  19. package/es/utils/index.js +592 -0
  20. package/es/utils/jsxTranslations.js +193 -0
  21. package/lib/I18NContext.js +6 -6
  22. package/lib/components/DateTimeDiffFormat.js +151 -123
  23. package/lib/components/FormatText.js +32 -22
  24. package/lib/components/HOCI18N.js +47 -23
  25. package/lib/components/I18N.js +62 -36
  26. package/lib/components/I18NProvider.js +85 -72
  27. package/lib/components/PluralFormat.js +42 -32
  28. package/lib/components/UserTimeDiffFormat.js +79 -56
  29. package/lib/components/__tests__/DateTimeDiffFormat.spec.js +815 -629
  30. package/lib/components/__tests__/FormatText.spec.js +23 -25
  31. package/lib/components/__tests__/HOCI18N.spec.js +26 -34
  32. package/lib/components/__tests__/I18N.spec.js +21 -26
  33. package/lib/components/__tests__/I18NProvider.spec.js +43 -51
  34. package/lib/components/__tests__/PluralFormat.spec.js +24 -28
  35. package/lib/components/__tests__/UserTimeDiffFormat.spec.js +1256 -1039
  36. package/lib/index.js +85 -110
  37. package/lib/utils/__tests__/jsxTranslations.spec.js +183 -0
  38. package/lib/utils/index.js +658 -0
  39. package/lib/utils/jsxTranslations.js +242 -0
  40. package/package.json +3 -2
  41. package/src/components/DateTimeDiffFormat.js +86 -55
  42. package/src/components/I18N.js +2 -0
  43. package/src/components/I18NProvider.js +44 -33
  44. package/src/components/UserTimeDiffFormat.js +24 -18
  45. package/src/index.js +7 -9
  46. package/src/utils/__tests__/jsxTranslations.spec.js +213 -0
  47. package/src/utils/index.js +632 -0
  48. package/src/utils/jsxTranslations.js +180 -0
  49. package/es/components/NewDateFormat.js +0 -50
  50. package/es/offset.js +0 -629
  51. package/es/timezones.js +0 -118
  52. package/es/utils.js +0 -621
  53. package/lib/components/NewDateFormat.js +0 -68
  54. package/lib/offset.js +0 -634
  55. package/lib/timezones.js +0 -129
  56. package/lib/utils.js +0 -651
  57. package/src/components/NewDateFormat.js +0 -60
  58. package/src/offset.js +0 -629
  59. package/src/timezones.js +0 -113
  60. package/src/utils.js +0 -648
@@ -1,89 +1,74 @@
1
- import _Object$assign from 'babel-runtime/core-js/object/assign';
2
- import _Object$keys from 'babel-runtime/core-js/object/keys';
3
- import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';
4
- import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
5
- import _createClass from 'babel-runtime/helpers/createClass';
6
- import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
7
- import _inherits from 'babel-runtime/helpers/inherits';
8
1
  import React, { Children } from 'react';
9
2
  import PropTypes from 'prop-types';
10
3
  import { replaceI18NValuesWithRegex, unescapeUnicode } from '../utils';
11
4
  import { HTMLPurifier } from '@zoho/SecurityJS';
12
5
  import { I18NContext } from '../I18NContext';
6
+ export default class I18N extends React.Component {
7
+ constructor(props) {
8
+ super(props);
9
+ this.getI18NValue = this.getI18NValue.bind(this);
10
+ this.createElement = this.createElement.bind(this);
11
+ }
13
12
 
14
- var I18N = function (_React$Component) {
15
- _inherits(I18N, _React$Component);
16
-
17
- function I18N(props) {
18
- _classCallCheck(this, I18N);
13
+ getI18NValue() {
14
+ const {
15
+ i18NKey: key,
16
+ values
17
+ } = this.props;
18
+ const {
19
+ i18n
20
+ } = this.context || {};
19
21
 
20
- var _this = _possibleConstructorReturn(this, (I18N.__proto__ || _Object$getPrototypeOf(I18N)).call(this, props));
22
+ if (typeof i18n === 'undefined') {
23
+ return key;
24
+ }
21
25
 
22
- _this.getI18NValue = _this.getI18NValue.bind(_this);
23
- _this.createElement = _this.createElement.bind(_this);
24
- return _this;
25
- }
26
+ let i18nStr = i18n[key];
26
27
 
27
- _createClass(I18N, [{
28
- key: 'getI18NValue',
29
- value: function getI18NValue() {
30
- var _props = this.props,
31
- key = _props.i18NKey,
32
- values = _props.values;
28
+ if (i18nStr === undefined) {
29
+ return key;
30
+ }
33
31
 
34
- var _ref = this.context || {},
35
- i18n = _ref.i18n;
32
+ i18nStr = replaceI18NValuesWithRegex(i18nStr, values);
33
+ return unescapeUnicode(i18nStr);
34
+ }
36
35
 
37
- if (typeof i18n === 'undefined') {
38
- return key;
39
- }
40
- var i18nStr = i18n[key];
41
- if (i18nStr === undefined) {
42
- return key;
36
+ createElement() {
37
+ const props = Object.keys(this.props).reduce((result, nextKey) => {
38
+ if (nextKey != 'i18NKey' && nextKey != 'tag' && nextKey != 'values' && nextKey != 'isHtml' && nextKey != 'dataId') {
39
+ result[nextKey] = this.props[nextKey];
43
40
  }
44
- i18nStr = replaceI18NValuesWithRegex(i18nStr, values);
45
- return unescapeUnicode(i18nStr);
46
- }
47
- }, {
48
- key: 'createElement',
49
- value: function createElement() {
50
- var _this2 = this;
51
41
 
52
- var props = _Object$keys(this.props).reduce(function (result, nextKey) {
53
- if (nextKey != 'i18NKey' && nextKey != 'tag' && nextKey != 'values' && nextKey != 'isHtml' && nextKey != 'dataId') {
54
- result[nextKey] = _this2.props[nextKey];
55
- }
56
- return result;
57
- }, {});
58
- //const child=this.getI18NValue();
59
- if (this.props.dataId) {
60
- props['data-id'] = this.props.dataId;
61
- }
62
- if (this.props.isHtml) {
63
- var dangerouslySetInnerHTML = {
64
- __html: HTMLPurifier.sanitize(this.getI18NValue())
65
- };
42
+ return result;
43
+ }, {}); //const child=this.getI18NValue();
66
44
 
67
- return React.createElement(this.props.tag, _Object$assign(props, { dangerouslySetInnerHTML: dangerouslySetInnerHTML }));
68
- }
69
- return React.createElement(this.props.tag, props, this.getI18NValue());
45
+ if (this.props.dataId) {
46
+ props['data-id'] = this.props.dataId;
47
+ props['data-test-id'] = this.props.dataId;
70
48
  }
71
- }, {
72
- key: 'render',
73
- value: function render() {
74
- return this.createElement();
49
+
50
+ if (this.props.isHtml) {
51
+ let dangerouslySetInnerHTML = {
52
+ __html: HTMLPurifier.sanitize(this.getI18NValue())
53
+ };
54
+ return /*#__PURE__*/React.createElement(this.props.tag, Object.assign(props, {
55
+ dangerouslySetInnerHTML
56
+ }));
75
57
  }
76
- }]);
77
58
 
78
- return I18N;
79
- }(React.Component);
59
+ return /*#__PURE__*/React.createElement(this.props.tag, props, this.getI18NValue());
60
+ }
80
61
 
81
- export default I18N;
62
+ render() {
63
+ return this.createElement();
64
+ }
82
65
 
66
+ }
83
67
  I18N.propTypes = {
84
68
  i18NKey: PropTypes.string.isRequired,
85
69
  isHtml: PropTypes.bool,
86
70
  tag: PropTypes.string,
71
+ dataId: PropTypes.string,
87
72
  values: PropTypes.oneOfType([PropTypes.string, PropTypes.array])
88
73
  };
89
74
  I18N.defaultProps = {
@@ -1,116 +1,91 @@
1
- import _Promise from 'babel-runtime/core-js/promise';
2
- import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';
3
- import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
4
- import _createClass from 'babel-runtime/helpers/createClass';
5
- import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
6
- import _inherits from 'babel-runtime/helpers/inherits';
7
1
  import React from 'react';
8
2
  import PropTypes from 'prop-types';
9
3
  import { getI18NValue, userDateFormat } from '../utils';
10
- import { unpack } from '../timezones';
11
- import { createSelector } from 'reselect';
4
+ import { getI18NComponent } from '../utils/jsxTranslations';
12
5
  import { I18NContext } from '../I18NContext';
6
+ const emptyObj = {};
13
7
 
14
- var emptyObj = {};
15
- var dummy = function dummy(key, values) {
16
- return key;
17
- };
18
- var getTzData = createSelector([function (tzStr) {
19
- return tzStr;
20
- }], function (tzStr) {
21
- return unpack(tzStr);
22
- });
23
- export var i18NProviderUtils = {
8
+ const dummy = (key, values) => key;
9
+
10
+ export const i18NProviderUtils = {
24
11
  getI18NValue: dummy,
25
- userDateFormat: dummy
12
+ userDateFormat: dummy,
13
+ getI18NComponent: dummy
26
14
  };
27
-
28
- var I18NProvider = function (_React$Component) {
29
- _inherits(I18NProvider, _React$Component);
30
-
31
- function I18NProvider(props, context) {
32
- _classCallCheck(this, I18NProvider);
33
-
34
- var _this = _possibleConstructorReturn(this, (I18NProvider.__proto__ || _Object$getPrototypeOf(I18NProvider)).call(this, props, context));
35
-
15
+ export default class I18NProvider extends React.Component {
16
+ constructor(props, context) {
17
+ super(props, context);
36
18
  i18NProviderUtils.getI18NValue = getI18NValue(props.i18n);
37
- i18NProviderUtils.userDateFormat = userDateFormat(i18NProviderUtils.getI18NValue, unpack(props.tzData));
38
- return _this;
19
+ i18NProviderUtils.getI18NComponent = getI18NComponent(props.i18n);
20
+
21
+ if (props.tzData) {
22
+ i18NProviderUtils.userDateFormat = userDateFormat(i18NProviderUtils.getI18NValue, props.tzData, props.timeFormat, props.datePattern, props.isEnabledCurrentYear);
23
+ }
39
24
  }
40
25
 
41
- _createClass(I18NProvider, [{
42
- key: 'componentDidUpdate',
43
- value: function componentDidUpdate(next) {
44
- var _this2 = this;
26
+ componentDidUpdate(prevProps) {
27
+ let {
28
+ i18n,
29
+ timeZone,
30
+ datePattern,
31
+ timeFormat,
32
+ direction,
33
+ onChange,
34
+ tzData,
35
+ isEnabledCurrentYear
36
+ } = this.props;
45
37
 
46
- var _props = this.props,
47
- i18n = _props.i18n,
48
- timeZone = _props.timeZone,
49
- datePattern = _props.datePattern,
50
- timeFormat = _props.timeFormat,
51
- dateTimeFormat = _props.dateTimeFormat,
52
- direction = _props.direction,
53
- onChange = _props.onChange,
54
- tzData = _props.tzData;
38
+ if (i18n !== prevProps.i18n || timeZone !== prevProps.timeZone || datePattern !== prevProps.datePattern || timeFormat !== prevProps.timeFormat || direction !== prevProps.direction || tzData !== prevProps.tzData || isEnabledCurrentYear !== prevProps.isEnabledCurrentYear) {
39
+ this.promise = new Promise((res, rej) => {
40
+ this.resolve = res;
41
+ this.reject = rej;
42
+ }).then(() => {
43
+ i18NProviderUtils.getI18NValue = getI18NValue(this.props.i18n);
44
+ i18NProviderUtils.getI18NComponent = getI18NComponent(this.props.i18n);
55
45
 
56
- if (i18n !== next.i18n || timeZone !== next.timeZone || datePattern !== next.datePattern || timeFormat !== next.timeFormat || dateTimeFormat !== next.dateTimeFormat || direction !== next.direction || tzData !== next.tzData) {
57
- this.promise = new _Promise(function (res, rej) {
58
- _this2.resolve = res;
59
- _this2.reject = rej;
60
- }).then(function () {
61
- i18NProviderUtils.getI18NValue = getI18NValue(nextProps.i18n);
62
- i18NProviderUtils.userDateFormat = userDateFormat(i18NProviderUtils.getI18NValue, unpack(tzData));
63
- _this2.promise = null;
64
- }, function () {
65
- _this2.promise = null;
66
- });
67
- onChange && onChange(this.resolve, this.reject);
68
- }
69
- }
70
- }, {
71
- key: 'render',
72
- value: function render() {
73
- return React.createElement(
74
- I18NContext.Provider,
75
- {
76
- value: {
77
- i18n: this.props.i18n,
78
- direction: this.props.direction,
79
- timeZone: this.props.timeZone,
80
- tzData: getTzData(this.props.tzData),
81
- datePattern: this.props.datePattern,
82
- timeFormat: this.props.timeFormat,
83
- dateTimeFormat: this.props.dateTimeFormat
84
- }
85
- },
86
- this.props.children
87
- );
88
- }
89
- }]);
46
+ if (this.props.tzData) {
47
+ i18NProviderUtils.userDateFormat = userDateFormat(i18NProviderUtils.getI18NValue, this.props.tzData, this.props.timeFormat, this.props.datePattern, this.props.isEnabledCurrentYear);
48
+ }
90
49
 
91
- return I18NProvider;
92
- }(React.Component);
93
-
94
- export default I18NProvider;
50
+ this.promise = null;
51
+ }, () => {
52
+ this.promise = null;
53
+ });
54
+ onChange && onChange(this.resolve, this.reject);
55
+ }
56
+ }
95
57
 
58
+ render() {
59
+ return /*#__PURE__*/React.createElement(I18NContext.Provider, {
60
+ value: {
61
+ i18n: this.props.i18n,
62
+ direction: this.props.direction,
63
+ timeZone: this.props.timeZone,
64
+ datePattern: this.props.datePattern,
65
+ timeFormat: this.props.timeFormat,
66
+ isEnabledCurrentYear: this.props.isEnabledCurrentYear,
67
+ tzData: this.props.tzData
68
+ }
69
+ }, this.props.children);
70
+ }
96
71
 
72
+ }
97
73
  I18NProvider.defaultProps = {
98
74
  i18n: emptyObj,
99
75
  timeZone: '',
100
76
  datePattern: '',
101
77
  timeFormat: '',
102
- dateTimeFormat: '',
78
+ isEnabledCurrentYear: '',
103
79
  direction: 'ltr'
104
80
  };
105
-
106
81
  I18NProvider.propTypes = {
107
82
  children: PropTypes.element.isRequired,
108
83
  datePattern: PropTypes.string,
109
- dateTimeFormat: PropTypes.string,
84
+ isEnabledCurrentYear: PropTypes.string,
110
85
  direction: PropTypes.string,
111
86
  i18n: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
112
87
  onChange: PropTypes.func,
113
88
  timeFormat: PropTypes.string,
114
89
  timeZone: PropTypes.string,
115
- tzData: PropTypes.string
90
+ tzData: PropTypes.object
116
91
  };
@@ -1,57 +1,38 @@
1
- import _extends from 'babel-runtime/helpers/extends';
2
- import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';
3
- import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
4
- import _createClass from 'babel-runtime/helpers/createClass';
5
- import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
6
- import _inherits from 'babel-runtime/helpers/inherits';
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
7
3
  import React from 'react';
8
4
  import PropTypes from 'prop-types';
9
5
  import FormatText from './FormatText';
10
-
11
- var PluralFormat = function (_React$Component) {
12
- _inherits(PluralFormat, _React$Component);
13
-
14
- function PluralFormat() {
15
- _classCallCheck(this, PluralFormat);
16
-
17
- return _possibleConstructorReturn(this, (PluralFormat.__proto__ || _Object$getPrototypeOf(PluralFormat)).apply(this, arguments));
18
- }
19
-
20
- _createClass(PluralFormat, [{
21
- key: 'render',
22
- value: function render() {
23
- var _props = this.props,
24
- one = _props.one,
25
- many = _props.many,
26
- zero = _props.zero,
27
- value = _props.value;
28
-
29
- var key = '',
30
- values = '';
31
- if (value > 1) {
32
- key = many;
33
- } else if (value == 1) {
34
- key = one;
35
- } else if (value == 0) {
36
- key = zero;
37
- }
38
- values = '' + value;
39
-
40
- return React.createElement(FormatText, _extends({}, this.props, {
41
- i18NKey: key,
42
- values: values,
43
- one: null,
44
- many: null,
45
- zero: null
46
- }));
6
+ export default class PluralFormat extends React.Component {
7
+ render() {
8
+ const {
9
+ one,
10
+ many,
11
+ zero,
12
+ value
13
+ } = this.props;
14
+ let key = '',
15
+ values = '';
16
+
17
+ if (value > 1) {
18
+ key = many;
19
+ } else if (value == 1) {
20
+ key = one;
21
+ } else if (value == 0) {
22
+ key = zero;
47
23
  }
48
- }]);
49
24
 
50
- return PluralFormat;
51
- }(React.Component);
52
-
53
- export default PluralFormat;
25
+ values = `${value}`;
26
+ return /*#__PURE__*/React.createElement(FormatText, _extends({}, this.props, {
27
+ i18NKey: key,
28
+ values: values,
29
+ one: null,
30
+ many: null,
31
+ zero: null
32
+ }));
33
+ }
54
34
 
35
+ }
55
36
  PluralFormat.propTypes = {
56
37
  many: PropTypes.string,
57
38
  one: PropTypes.string,
@@ -1,91 +1,82 @@
1
- import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of';
2
- import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
3
- import _createClass from 'babel-runtime/helpers/createClass';
4
- import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
5
- import _inherits from 'babel-runtime/helpers/inherits';
6
1
  import React, { Component } from 'react';
7
2
  import PropTypes from 'prop-types';
8
3
  import DateTimeDiffFormat from './DateTimeDiffFormat';
9
4
  import { I18NContext } from '../I18NContext';
5
+ export default class UserTimeDiffFormat extends Component {
6
+ render() {
7
+ let currentTime = new Date();
8
+ let currentTimeUTCString = currentTime.toISOString();
9
+ let {
10
+ type,
11
+ page,
12
+ isNeedTime,
13
+ to,
14
+ today,
15
+ yesterday,
16
+ tomorrow,
17
+ others,
18
+ ago,
19
+ later,
20
+ format,
21
+ title,
22
+ className,
23
+ displayType,
24
+ dataId,
25
+ isOverdue,
26
+ isDateField
27
+ } = this.props;
28
+ let {
29
+ tzData,
30
+ timeFormat,
31
+ datePattern,
32
+ isEnabledCurrentYear
33
+ } = this.context || {};
10
34
 
11
- var UserTimeDiffFormat = function (_Component) {
12
- _inherits(UserTimeDiffFormat, _Component);
13
-
14
- function UserTimeDiffFormat() {
15
- _classCallCheck(this, UserTimeDiffFormat);
16
-
17
- return _possibleConstructorReturn(this, (UserTimeDiffFormat.__proto__ || _Object$getPrototypeOf(UserTimeDiffFormat)).apply(this, arguments));
18
- }
19
-
20
- _createClass(UserTimeDiffFormat, [{
21
- key: 'render',
22
- value: function render() {
23
- var currentTime = new Date();
24
- var currentTimeUTCString = currentTime.toISOString();
25
- var _props = this.props,
26
- type = _props.type,
27
- to = _props.to,
28
- today = _props.today,
29
- yesterday = _props.yesterday,
30
- tomorrow = _props.tomorrow,
31
- others = _props.others,
32
- ago = _props.ago,
33
- later = _props.later,
34
- format = _props.format,
35
- title = _props.title,
36
- className = _props.className,
37
- displayType = _props.displayType,
38
- dataId = _props.dataId,
39
- isOverdue = _props.isOverdue;
40
-
41
- var _ref = this.context || {},
42
- tzData = _ref.tzData,
43
- timeFormat = _ref.timeFormat,
44
- datePattern = _ref.datePattern,
45
- dateTimeFormat = _ref.dateTimeFormat,
46
- timeZone = _ref.timeZone;
47
-
48
- if (!format && !others) {
49
- var pattern = displayType === 'date' ? datePattern : displayType === 'time' ? timeFormat : displayType === 'dateTime' ? dateTimeFormat : '';
50
- format = function format() {
51
- return pattern;
52
- };
53
- }
54
-
55
- var tz = tzData || timeZone;
56
-
57
- return React.createElement(DateTimeDiffFormat, {
58
- type: type,
59
- from: currentTimeUTCString,
60
- fromTzData: tz,
61
- to: to,
62
- toTzData: tz,
63
- today: today,
64
- yesterday: yesterday,
65
- tomorrow: tomorrow,
66
- others: others,
67
- ago: ago,
68
- later: later,
69
- format: format,
70
- title: title,
71
- className: className,
72
- dataId: dataId,
73
- isOverdue: isOverdue
74
- });
35
+ if (!format && !others) {
36
+ format = _ref => {
37
+ let {
38
+ dateTimeFormat,
39
+ dateFormat,
40
+ timeFormat
41
+ } = _ref;
42
+ displayType === 'dateTime' ? dateTimeFormat : displayType === 'date' ? dateFormat : timeFormat;
43
+ };
75
44
  }
76
- }]);
77
45
 
78
- return UserTimeDiffFormat;
79
- }(Component);
80
-
81
- export default UserTimeDiffFormat;
46
+ return /*#__PURE__*/React.createElement(DateTimeDiffFormat, {
47
+ type: type,
48
+ page: page,
49
+ isNeedTime: isNeedTime,
50
+ from: currentTimeUTCString,
51
+ fromTzData: tzData,
52
+ to: to,
53
+ toTzData: tzData,
54
+ today: today,
55
+ yesterday: yesterday,
56
+ tomorrow: tomorrow,
57
+ others: others,
58
+ ago: ago,
59
+ later: later,
60
+ format: format,
61
+ title: title,
62
+ className: className,
63
+ dataId: dataId,
64
+ isOverdue: isOverdue,
65
+ timeFormat: timeFormat,
66
+ datePattern: datePattern,
67
+ isEnabledCurrentYear: isEnabledCurrentYear,
68
+ isDateField: isDateField
69
+ });
70
+ }
82
71
 
72
+ }
83
73
  UserTimeDiffFormat.propTypes = {
84
74
  ago: PropTypes.string,
85
75
  className: PropTypes.string,
86
76
  dataId: PropTypes.string,
87
77
  displayType: PropTypes.oneOf(['date', 'time', 'dateTime']),
88
78
  format: PropTypes.func,
79
+ isDateField: PropTypes.bool,
89
80
  later: PropTypes.string,
90
81
  others: PropTypes.func,
91
82
  title: PropTypes.string,