@zohodesk/i18n 1.0.0-beta.20 → 1.0.0-beta.21

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 (52) hide show
  1. package/README.md +85 -80
  2. package/es/components/DateTimeDiffFormat.js +2 -1
  3. package/es/components/HOCI18N.js +1 -1
  4. package/es/components/PluralFormat.js +1 -1
  5. package/es/components/__tests__/I18N.spec.js +1 -1
  6. package/es/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
  7. package/es/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
  8. package/es/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
  9. package/es/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
  10. package/es/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
  11. package/es/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
  12. package/es/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
  13. package/lib/components/DateTimeDiffFormat.js +4 -3
  14. package/lib/components/FormatText.js +2 -2
  15. package/lib/components/HOCI18N.js +3 -3
  16. package/lib/components/I18N.js +2 -2
  17. package/lib/components/I18NProvider.js +2 -2
  18. package/lib/components/PluralFormat.js +3 -3
  19. package/lib/components/UserTimeDiffFormat.js +2 -2
  20. package/lib/components/__tests__/I18N.spec.js +1 -1
  21. package/lib/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
  22. package/lib/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
  23. package/lib/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
  24. package/lib/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
  25. package/lib/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
  26. package/lib/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
  27. package/lib/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
  28. package/package.json +29 -29
  29. package/src/I18NContext.js +2 -2
  30. package/src/components/DateTimeDiffFormat.js +256 -256
  31. package/src/components/FormatText.js +14 -14
  32. package/src/components/HOCI18N.js +37 -37
  33. package/src/components/I18N.js +72 -72
  34. package/src/components/I18NProvider.js +110 -110
  35. package/src/components/PluralFormat.js +37 -37
  36. package/src/components/UserTimeDiffFormat.js +97 -97
  37. package/src/components/__tests__/DateTimeDiffFormat.spec.js +618 -618
  38. package/src/components/__tests__/FormatText.spec.js +26 -26
  39. package/src/components/__tests__/HOCI18N.spec.js +33 -33
  40. package/src/components/__tests__/I18N.spec.js +29 -29
  41. package/src/components/__tests__/I18NProvider.spec.js +65 -65
  42. package/src/components/__tests__/PluralFormat.spec.js +27 -27
  43. package/src/components/__tests__/UserTimeDiffFormat.spec.js +1076 -1076
  44. package/src/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
  45. package/src/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
  46. package/src/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
  47. package/src/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
  48. package/src/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
  49. package/src/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
  50. package/src/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
  51. package/src/index.js +33 -33
  52. package/src/utils.js +527 -527
package/package.json CHANGED
@@ -1,29 +1,29 @@
1
- {
2
- "name": "@zohodesk/i18n",
3
- "version": "1.0.0-beta.20",
4
- "main": "lib/index",
5
- "module": "es/index.js",
6
- "jsnext:main": "es/index.js",
7
- "private": false,
8
- "umdVar": "i18n",
9
- "author": "",
10
- "license": "ISC",
11
- "scripts": {
12
- "clean": "react-cli clean lib es coverage",
13
- "build": "react-cli build:component:cmjs",
14
- "build:es": "react-cli build:library:es",
15
- "build:dev": "npm run clean && npm run build --module:mode=dev -- -w",
16
- "prepublish": "npm run init && npm run build && npm run build:es ",
17
- "prepare": "npm run init && npm run build && npm run build:es",
18
- "init": "npm run clean",
19
- "lint": "react-cli lint"
20
- },
21
- "dependencies": {
22
- "@zoho/SecurityJS": "5.0.2"
23
- },
24
- "react-cli": {
25
- "docs": {
26
- "componentFolder": "./src"
27
- }
28
- }
29
- }
1
+ {
2
+ "name": "@zohodesk/i18n",
3
+ "version": "1.0.0-beta.21",
4
+ "main": "lib/index",
5
+ "module": "es/index.js",
6
+ "jsnext:main": "es/index.js",
7
+ "private": false,
8
+ "umdVar": "i18n",
9
+ "author": "",
10
+ "license": "ISC",
11
+ "scripts": {
12
+ "clean": "react-cli clean lib es coverage",
13
+ "build": "react-cli build:component:cmjs",
14
+ "build:es": "react-cli build:library:es",
15
+ "build:dev": "npm run clean && npm run build --module:mode=dev -- -w",
16
+ "prepublish": "npm run init && npm run build && npm run build:es ",
17
+ "prepare": "npm run init && npm run build && npm run build:es",
18
+ "init": "npm run clean",
19
+ "lint": "react-cli lint"
20
+ },
21
+ "dependencies": {
22
+ "@zoho/SecurityJS": "5.0.2"
23
+ },
24
+ "react-cli": {
25
+ "docs": {
26
+ "componentFolder": "./src"
27
+ }
28
+ }
29
+ }
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
-
1
+ import React from 'react';
2
+
3
3
  export const I18NContext = React.createContext();
@@ -1,256 +1,256 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import {
4
- pad,
5
- getValues,
6
- getDiffObj,
7
- formatDate,
8
- getLyears,
9
- getDatePatternWithoutYear,
10
- } from '../utils';
11
- import FormatText from './FormatText';
12
- import datetime from '@zohodesk/datetimejs';
13
- export default class DateTimeDiffFormat extends React.Component {
14
- constructor(props) {
15
- super(props);
16
- this.getSuffix = this.getSuffix.bind(this);
17
- }
18
-
19
- getSuffix(min) {
20
- let suffix;
21
- if (this.props.ago && min < 0) {
22
- suffix = this.props.ago || '';
23
- } else if (this.props.later || min > 0) {
24
- suffix = this.props.later || '';
25
- } else {
26
- suffix = '';
27
- }
28
- return suffix;
29
- }
30
-
31
- render() {
32
- const {
33
- type,
34
- page,
35
- isNeedTime,
36
- from,
37
- fromTzData,
38
- to,
39
- toTzData,
40
- today,
41
- yesterday,
42
- tomorrow,
43
- others,
44
- format,
45
- dataId,
46
- className = null,
47
- title = null,
48
- isOverdue,
49
- timeFormat,
50
- datePattern,
51
- isEnabledCurrentYear,
52
- isDateField
53
- } = this.props;
54
-
55
- let fromDateObj = datetime
56
- .toDate(datetime.tz.utcToTz(from, fromTzData))
57
- .getTime();
58
- let toDateObj = datetime
59
- .toDate(isDateField ? to : datetime.tz.utcToTz(to, toTzData))
60
- .getTime();
61
-
62
- let diffMin = new Date(to).getTime() - new Date(from).getTime();
63
- let suffix = this.getSuffix(diffMin);
64
- let diff = getDiffObj(diffMin);
65
- let withInAWeak = diff.y === 0 && diff.yd <= 7;
66
-
67
- let diffObj = {
68
- h: diff.h,
69
- m: diff.m,
70
- s: diff.s,
71
- y: diff.y,
72
- hh: pad(diff.h, 2),
73
- mm: pad(diff.m, 2),
74
- ss: pad(diff.s, 2),
75
- yy: pad(diff.y, 2),
76
- days: diff.yd,
77
- yDays: pad(diff.yd, 2),
78
- isWithInAWeek: withInAWeak,
79
- suffix: suffix,
80
- };
81
- let diffObj1 = {
82
- to: to,
83
- type: type,
84
- page: page,
85
- isNeedTime: isNeedTime,
86
- hours: diff.h,
87
- minutes: diff.m,
88
- seconds: diff.s,
89
- years: diff.y,
90
- yDays: diff.yd,
91
- isWithInAWeek: withInAWeak,
92
- suffix: suffix,
93
- crntDate: new Date(from).getDate(),
94
- crntMonth: new Date(from).getMonth(),
95
- crntYear: new Date(from).getFullYear(),
96
- crntHours: new Date(from).getHours(),
97
- crntMinutes: new Date(from).getMinutes(),
98
- crntSeconds: new Date(from).getSeconds(),
99
- tDate: new Date(to).getDate(),
100
- tMonth: new Date(to).getMonth(),
101
- tYear: new Date(to).getFullYear(),
102
- tHours: new Date(to).getHours(),
103
- tMinutes: new Date(to).getMinutes(),
104
- tSeconds: new Date(to).getSeconds(),
105
- betweenleepYears: getLyears(from, to),
106
- isOverdue: isOverdue,
107
- timeFormat: timeFormat,
108
- datePattern: datePattern,
109
- dateTimePattern: `${datePattern} ${timeFormat}`,
110
- };
111
-
112
- //In if condition we'll remove year and set date format if the current year is not required
113
- //In else part we'll set the date format as it is
114
- if (
115
- isEnabledCurrentYear === true &&
116
- diffObj1.years === 0 &&
117
- diffObj1.tYear === diffObj1.crntYear
118
- ) {
119
- let dateFormat = getDatePatternWithoutYear(datePattern);
120
- diffObj1.dateFormat = dateFormat;
121
- diffObj1.dateTimeFormat = `${dateFormat} ${timeFormat}`;
122
- } else {
123
- diffObj1.dateFormat = datePattern;
124
- diffObj1.dateTimeFormat = `${datePattern} ${timeFormat}`;
125
- }
126
-
127
- let key = '';
128
- let values = [];
129
- let text = null;
130
- let isSuffixEnable = false;
131
- if (format) {
132
- let years, months, days, hours, minutes, seconds;
133
- years = diffObj1.years > 1 ? '2' : diffObj1.years;
134
-
135
- days = diff.yd > 1 ? '2' : diff.yd;
136
- hours = diffObj1.hours > 1 ? '2' : diffObj1.hours;
137
- minutes = diffObj1.minutes > 1 ? '2' : diffObj1.minutes;
138
-
139
- let count = 0;
140
- let pattern = [years, days, hours, minutes].reduce((res, next) => {
141
- if (count === 2) {
142
- res = `${res}0`;
143
- } else if (next !== 0) {
144
- count++;
145
- res = res + next;
146
- } else {
147
- res = res + next;
148
- }
149
- return res;
150
- }, '');
151
-
152
- let value = format(diffObj1, pattern);
153
- if (value && typeof value === 'object') {
154
- key = value.key;
155
- values = getValues(value.params, diffObj);
156
- if (pattern.indexOf('00000') === 0) {
157
- //suffix ignore for second hook
158
- isSuffixEnable = false;
159
- } else {
160
- isSuffixEnable = true;
161
- }
162
- } else if (typeof value === 'string') {
163
- text = formatDate(toDateObj, value, diffObj1);
164
- }
165
- } else {
166
- let dateObj = new Date(toDateObj);
167
- let curDateObj = new Date(fromDateObj);
168
- let diffDayType = diffObj1.yDays;
169
-
170
- //In this condition, to calculate different days we have copied it from live --> diffDayType
171
- if (
172
- isOverdue &&
173
- dateObj.getDate() < curDateObj.getDate() &&
174
- diffObj1.yDays == 0
175
- ) {
176
- diffDayType = -1;
177
- }
178
- if (!isOverdue) {
179
- let diffHr = dateObj.getHours() - curDateObj.getHours();
180
- if (diffHr < 0) {
181
- diffDayType += 1;
182
- } else if (diffHr == 0) {
183
- let diffMins = dateObj.getMinutes() - curDateObj.getMinutes();
184
- if (diffMins < 0) {
185
- diffDayType += 1;
186
- } else if (diffMins == 0) {
187
- let diffSec = dateObj.getSeconds() - curDateObj.getSeconds();
188
- if (diffSec < 0) {
189
- diffDayType += 1;
190
- }
191
- }
192
- }
193
- }
194
- if (diff.y === 0 && (diffDayType === 0 || diffDayType === 1)) {
195
- if (dateObj.getDate() === curDateObj.getDate()) {
196
- var value = (today && today(diffObj1)) || others(diffObj1);
197
- text = formatDate(toDateObj, value);
198
- } else if (
199
- (dateObj.getMonth() === curDateObj.getMonth() &&
200
- dateObj.getDate() < curDateObj.getDate()) ||
201
- dateObj.getMonth() < curDateObj.getMonth()
202
- ) {
203
- var value = (yesterday && yesterday(diffObj1)) || others(diffObj1);
204
- text = formatDate(toDateObj, value);
205
- } else if (!isOverdue && diff.y === 0 && diffDayType === 1) {
206
- var value = (tomorrow && tomorrow(diffObj1)) || others(diffObj1);
207
- text = formatDate(toDateObj, value);
208
- }
209
- } else {
210
- var value = others(diffObj1);
211
- text = formatDate(toDateObj, value);
212
- }
213
- }
214
- return text ? (
215
- <span className={className} data-title={title} data-id={dataId}>
216
- {text}
217
- </span>
218
- ) : (
219
- <FormatText
220
- i18NKey={isSuffixEnable && suffix !== '' ? `${key}.${suffix}` : key}
221
- values={values}
222
- className={className}
223
- data-title={title}
224
- />
225
- );
226
- }
227
- }
228
- DateTimeDiffFormat.propTypes = {
229
- ago: PropTypes.string,
230
- className: PropTypes.string,
231
- dataId: PropTypes.string,
232
- format: PropTypes.func,
233
- from: PropTypes.string,
234
- fromTzData: PropTypes.object,
235
- isDateField: PropTypes.bool,
236
- later: PropTypes.string,
237
- others: PropTypes.func,
238
- title: PropTypes.string,
239
- to: PropTypes.string,
240
- toTzData: PropTypes.object,
241
- today: PropTypes.oneOfType([
242
- PropTypes.string,
243
- PropTypes.object,
244
- PropTypes.func,
245
- ]),
246
- tomorrow: PropTypes.oneOfType([
247
- PropTypes.string,
248
- PropTypes.object,
249
- PropTypes.func,
250
- ]),
251
- yesterday: PropTypes.oneOfType([
252
- PropTypes.string,
253
- PropTypes.object,
254
- PropTypes.func,
255
- ]),
256
- };
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import {
4
+ pad,
5
+ getValues,
6
+ getDiffObj,
7
+ formatDate,
8
+ getLyears,
9
+ getDatePatternWithoutYear,
10
+ } from '../utils';
11
+ import FormatText from './FormatText';
12
+ import datetime from '@zohodesk/datetimejs';
13
+ export default class DateTimeDiffFormat extends React.Component {
14
+ constructor(props) {
15
+ super(props);
16
+ this.getSuffix = this.getSuffix.bind(this);
17
+ }
18
+
19
+ getSuffix(min) {
20
+ let suffix;
21
+ if (this.props.ago && min < 0) {
22
+ suffix = this.props.ago || '';
23
+ } else if (this.props.later || min > 0) {
24
+ suffix = this.props.later || '';
25
+ } else {
26
+ suffix = '';
27
+ }
28
+ return suffix;
29
+ }
30
+
31
+ render() {
32
+ const {
33
+ type,
34
+ page,
35
+ isNeedTime,
36
+ from,
37
+ fromTzData,
38
+ to,
39
+ toTzData,
40
+ today,
41
+ yesterday,
42
+ tomorrow,
43
+ others,
44
+ format,
45
+ dataId,
46
+ className = null,
47
+ title = null,
48
+ isOverdue,
49
+ timeFormat,
50
+ datePattern,
51
+ isEnabledCurrentYear,
52
+ isDateField
53
+ } = this.props;
54
+
55
+ let fromDateObj = datetime
56
+ .toDate(datetime.tz.utcToTz(from, fromTzData))
57
+ .getTime();
58
+ let toDateObj = datetime
59
+ .toDate(isDateField ? to : datetime.tz.utcToTz(to, toTzData))
60
+ .getTime();
61
+
62
+ let diffMin = new Date(to).getTime() - new Date(from).getTime();
63
+ let suffix = this.getSuffix(diffMin);
64
+ let diff = getDiffObj(diffMin);
65
+ let withInAWeak = diff.y === 0 && diff.yd <= 7;
66
+
67
+ let diffObj = {
68
+ h: diff.h,
69
+ m: diff.m,
70
+ s: diff.s,
71
+ y: diff.y,
72
+ hh: pad(diff.h, 2),
73
+ mm: pad(diff.m, 2),
74
+ ss: pad(diff.s, 2),
75
+ yy: pad(diff.y, 2),
76
+ days: diff.yd,
77
+ yDays: pad(diff.yd, 2),
78
+ isWithInAWeek: withInAWeak,
79
+ suffix: suffix,
80
+ };
81
+ let diffObj1 = {
82
+ to: to,
83
+ type: type,
84
+ page: page,
85
+ isNeedTime: isNeedTime,
86
+ hours: diff.h,
87
+ minutes: diff.m,
88
+ seconds: diff.s,
89
+ years: diff.y,
90
+ yDays: diff.yd,
91
+ isWithInAWeek: withInAWeak,
92
+ suffix: suffix,
93
+ crntDate: new Date(from).getDate(),
94
+ crntMonth: new Date(from).getMonth(),
95
+ crntYear: new Date(from).getFullYear(),
96
+ crntHours: new Date(from).getHours(),
97
+ crntMinutes: new Date(from).getMinutes(),
98
+ crntSeconds: new Date(from).getSeconds(),
99
+ tDate: new Date(to).getDate(),
100
+ tMonth: new Date(to).getMonth(),
101
+ tYear: new Date(to).getFullYear(),
102
+ tHours: new Date(to).getHours(),
103
+ tMinutes: new Date(to).getMinutes(),
104
+ tSeconds: new Date(to).getSeconds(),
105
+ betweenleepYears: getLyears(from, to),
106
+ isOverdue: isOverdue,
107
+ timeFormat: timeFormat,
108
+ datePattern: datePattern,
109
+ dateTimePattern: `${datePattern} ${timeFormat}`,
110
+ };
111
+
112
+ //In if condition we'll remove year and set date format if the current year is not required
113
+ //In else part we'll set the date format as it is
114
+ if (
115
+ isEnabledCurrentYear === true &&
116
+ diffObj1.years === 0 &&
117
+ diffObj1.tYear === diffObj1.crntYear
118
+ ) {
119
+ let dateFormat = getDatePatternWithoutYear(datePattern);
120
+ diffObj1.dateFormat = dateFormat;
121
+ diffObj1.dateTimeFormat = `${dateFormat} ${timeFormat}`;
122
+ } else {
123
+ diffObj1.dateFormat = datePattern;
124
+ diffObj1.dateTimeFormat = `${datePattern} ${timeFormat}`;
125
+ }
126
+
127
+ let key = '';
128
+ let values = [];
129
+ let text = null;
130
+ let isSuffixEnable = false;
131
+ if (format) {
132
+ let years, months, days, hours, minutes, seconds;
133
+ years = diffObj1.years > 1 ? '2' : diffObj1.years;
134
+
135
+ days = diff.yd > 1 ? '2' : diff.yd;
136
+ hours = diffObj1.hours > 1 ? '2' : diffObj1.hours;
137
+ minutes = diffObj1.minutes > 1 ? '2' : diffObj1.minutes;
138
+
139
+ let count = 0;
140
+ let pattern = [years, days, hours, minutes].reduce((res, next) => {
141
+ if (count === 2) {
142
+ res = `${res}0`;
143
+ } else if (next !== 0) {
144
+ count++;
145
+ res = res + next;
146
+ } else {
147
+ res = res + next;
148
+ }
149
+ return res;
150
+ }, '');
151
+
152
+ let value = format(diffObj1, pattern);
153
+ if (value && typeof value === 'object') {
154
+ key = value.key;
155
+ values = getValues(value.params, diffObj);
156
+ if (pattern.indexOf('00000') === 0) {
157
+ //suffix ignore for second hook
158
+ isSuffixEnable = false;
159
+ } else {
160
+ isSuffixEnable = true;
161
+ }
162
+ } else if (typeof value === 'string') {
163
+ text = formatDate(toDateObj, value, diffObj1);
164
+ }
165
+ } else {
166
+ let dateObj = new Date(toDateObj);
167
+ let curDateObj = new Date(fromDateObj);
168
+ let diffDayType = diffObj1.yDays;
169
+
170
+ //In this condition, to calculate different days we have copied it from live --> diffDayType
171
+ if (
172
+ isOverdue &&
173
+ dateObj.getDate() < curDateObj.getDate() &&
174
+ diffObj1.yDays == 0
175
+ ) {
176
+ diffDayType = -1;
177
+ }
178
+ if (!isOverdue) {
179
+ let diffHr = dateObj.getHours() - curDateObj.getHours();
180
+ if (diffHr < 0) {
181
+ diffDayType += 1;
182
+ } else if (diffHr == 0) {
183
+ let diffMins = dateObj.getMinutes() - curDateObj.getMinutes();
184
+ if (diffMins < 0) {
185
+ diffDayType += 1;
186
+ } else if (diffMins == 0) {
187
+ let diffSec = dateObj.getSeconds() - curDateObj.getSeconds();
188
+ if (diffSec < 0) {
189
+ diffDayType += 1;
190
+ }
191
+ }
192
+ }
193
+ }
194
+ if (diff.y === 0 && (diffDayType === 0 || diffDayType === 1)) {
195
+ if (dateObj.getDate() === curDateObj.getDate()) {
196
+ var value = (today && today(diffObj1)) || others(diffObj1);
197
+ text = formatDate(toDateObj, value);
198
+ } else if (
199
+ (dateObj.getMonth() === curDateObj.getMonth() &&
200
+ dateObj.getDate() < curDateObj.getDate()) ||
201
+ dateObj.getMonth() < curDateObj.getMonth()
202
+ ) {
203
+ var value = (yesterday && yesterday(diffObj1)) || others(diffObj1);
204
+ text = formatDate(toDateObj, value);
205
+ } else if (!isOverdue && diff.y === 0 && diffDayType === 1) {
206
+ var value = (tomorrow && tomorrow(diffObj1)) || others(diffObj1);
207
+ text = formatDate(toDateObj, value);
208
+ }
209
+ } else {
210
+ var value = others(diffObj1);
211
+ text = formatDate(toDateObj, value);
212
+ }
213
+ }
214
+ return text ? (
215
+ <span className={className} data-title={title} data-id={dataId} data-test-id={dataId}>
216
+ {text}
217
+ </span>
218
+ ) : (
219
+ <FormatText
220
+ i18NKey={isSuffixEnable && suffix !== '' ? `${key}.${suffix}` : key}
221
+ values={values}
222
+ className={className}
223
+ data-title={title}
224
+ />
225
+ );
226
+ }
227
+ }
228
+ DateTimeDiffFormat.propTypes = {
229
+ ago: PropTypes.string,
230
+ className: PropTypes.string,
231
+ dataId: PropTypes.string,
232
+ format: PropTypes.func,
233
+ from: PropTypes.string,
234
+ fromTzData: PropTypes.object,
235
+ isDateField: PropTypes.bool,
236
+ later: PropTypes.string,
237
+ others: PropTypes.func,
238
+ title: PropTypes.string,
239
+ to: PropTypes.string,
240
+ toTzData: PropTypes.object,
241
+ today: PropTypes.oneOfType([
242
+ PropTypes.string,
243
+ PropTypes.object,
244
+ PropTypes.func,
245
+ ]),
246
+ tomorrow: PropTypes.oneOfType([
247
+ PropTypes.string,
248
+ PropTypes.object,
249
+ PropTypes.func,
250
+ ]),
251
+ yesterday: PropTypes.oneOfType([
252
+ PropTypes.string,
253
+ PropTypes.object,
254
+ PropTypes.func,
255
+ ]),
256
+ };
@@ -1,14 +1,14 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import I18N from './I18N';
4
-
5
- export default class FormatText extends React.Component {
6
- render() {
7
- return <I18N {...this.props} />;
8
- }
9
- }
10
- FormatText.propTypes = {
11
- i18NKey: PropTypes.string.isRequired,
12
- isHtml: PropTypes.bool,
13
- values: PropTypes.oneOfType([PropTypes.string, PropTypes.array])
14
- };
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import I18N from './I18N';
4
+
5
+ export default class FormatText extends React.Component {
6
+ render() {
7
+ return <I18N {...this.props} />;
8
+ }
9
+ }
10
+ FormatText.propTypes = {
11
+ i18NKey: PropTypes.string.isRequired,
12
+ isHtml: PropTypes.bool,
13
+ values: PropTypes.oneOfType([PropTypes.string, PropTypes.array])
14
+ };