@zohodesk/i18n 1.0.0-beta.18 → 1.0.0-beta.19

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 (42) hide show
  1. package/README.md +76 -73
  2. package/es/components/I18NProvider.js +9 -2
  3. package/es/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
  4. package/es/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
  5. package/es/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
  6. package/es/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
  7. package/es/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
  8. package/es/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
  9. package/es/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
  10. package/lib/components/I18NProvider.js +10 -2
  11. package/lib/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
  12. package/lib/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
  13. package/lib/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
  14. package/lib/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
  15. package/lib/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
  16. package/lib/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
  17. package/lib/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
  18. package/package.json +28 -28
  19. package/src/I18NContext.js +2 -2
  20. package/src/components/DateTimeDiffFormat.js +254 -254
  21. package/src/components/FormatText.js +14 -14
  22. package/src/components/HOCI18N.js +37 -37
  23. package/src/components/I18N.js +72 -72
  24. package/src/components/I18NProvider.js +110 -106
  25. package/src/components/PluralFormat.js +37 -37
  26. package/src/components/UserTimeDiffFormat.js +94 -94
  27. package/src/components/__tests__/DateTimeDiffFormat.spec.js +618 -618
  28. package/src/components/__tests__/FormatText.spec.js +26 -26
  29. package/src/components/__tests__/HOCI18N.spec.js +33 -33
  30. package/src/components/__tests__/I18N.spec.js +29 -29
  31. package/src/components/__tests__/I18NProvider.spec.js +65 -65
  32. package/src/components/__tests__/PluralFormat.spec.js +27 -27
  33. package/src/components/__tests__/UserTimeDiffFormat.spec.js +1076 -1076
  34. package/src/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
  35. package/src/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
  36. package/src/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
  37. package/src/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
  38. package/src/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
  39. package/src/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
  40. package/src/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
  41. package/src/index.js +33 -33
  42. package/src/utils.js +527 -527
@@ -1,366 +1,366 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`UserTimeDiffFormat component Should display other - greater time 1`] = `
4
- <span
5
- className={null}
6
- data-title={null}
7
- >
8
- yesterday
9
- </span>
10
- `;
11
-
12
- exports[`UserTimeDiffFormat component Should display other - less time 1`] = `
13
- <span
14
- className={null}
15
- data-title={null}
16
- >
17
- less 7 23-10-2016
18
- </span>
19
- `;
20
-
21
- exports[`UserTimeDiffFormat component Should display other - same time 1`] = `
22
- <span
23
- className={null}
24
- data-title={null}
25
- >
26
- less 7 23-10-2016
27
- </span>
28
- `;
29
-
30
- exports[`UserTimeDiffFormat component Should display other later- less time 1`] = `
31
- <span
32
- className={null}
33
- data-title={null}
34
- >
35
- less 7 27-10-2016
36
- </span>
37
- `;
38
-
39
- exports[`UserTimeDiffFormat component Should display other later- less time 2`] = `
40
- <span
41
- className={null}
42
- data-title={null}
43
- >
44
- tomorrow
45
- </span>
46
- `;
47
-
48
- exports[`UserTimeDiffFormat component Should display other later- same time 1`] = `
49
- <span
50
- className={null}
51
- data-title={null}
52
- >
53
- less 7 27-10-2016
54
- </span>
55
- `;
56
-
57
- exports[`UserTimeDiffFormat component Should display others 1`] = `
58
- <span
59
- className={null}
60
- data-title={null}
61
- >
62
- less 7 27-11-2016
63
- </span>
64
- `;
65
-
66
- exports[`UserTimeDiffFormat component Should display today ago - user 1`] = `
67
- <span
68
- className={null}
69
- data-title={null}
70
- >
71
- 00:00:01 ago
72
- </span>
73
- `;
74
-
75
- exports[`UserTimeDiffFormat component Should display today ago 1`] = `
76
- <span
77
- className={null}
78
- data-title={null}
79
- >
80
- 00:00:01 later
81
- </span>
82
- `;
83
-
84
- exports[`UserTimeDiffFormat component Should display today key - greater than 24 hour 1`] = `
85
- <span
86
- className={null}
87
- data-title={null}
88
- >
89
- today.later
90
- </span>
91
- `;
92
-
93
- exports[`UserTimeDiffFormat component Should display today key - less than 24 hour 1`] = `
94
- <span
95
- className={null}
96
- data-title={null}
97
- >
98
- today.ago
99
- </span>
100
- `;
101
-
102
- exports[`UserTimeDiffFormat component Should display today key - same time 1`] = `
103
- <span
104
- className={null}
105
- data-title={null}
106
- >
107
- today
108
- </span>
109
- `;
110
-
111
- exports[`UserTimeDiffFormat component Should display today key - user 1`] = `
112
- <span
113
- className={null}
114
- data-title={null}
115
- >
116
- today
117
- </span>
118
- `;
119
-
120
- exports[`UserTimeDiffFormat component Should display today later - user 1`] = `
121
- <span
122
- className={null}
123
- data-title={null}
124
- >
125
- 00:00:01 later
126
- </span>
127
- `;
128
-
129
- exports[`UserTimeDiffFormat component Should display today later 1`] = `
130
- <span
131
- className={null}
132
- data-title={null}
133
- >
134
- 00:00:01 later
135
- </span>
136
- `;
137
-
138
- exports[`UserTimeDiffFormat component Should display today1 1`] = `
139
- <div>
140
- <span
141
- className={null}
142
- data-title={null}
143
- >
144
-
145
- </span>
146
- <span
147
- className={null}
148
- data-title={null}
149
- >
150
-
151
- </span>
152
- <span
153
- className={null}
154
- data-title={null}
155
- >
156
-
157
- </span>
158
- <span
159
- className={null}
160
- data-title={null}
161
- >
162
-
163
- </span>
164
- <span
165
- className={null}
166
- data-title={null}
167
- >
168
-
169
- </span>
170
- <span
171
- className={null}
172
- data-title={null}
173
- >
174
-
175
- </span>
176
- <span
177
- className={null}
178
- data-title={null}
179
- >
180
-
181
- </span>
182
- <span
183
- className={null}
184
- data-title={null}
185
- >
186
-
187
- </span>
188
- <span
189
- className={null}
190
- data-title={null}
191
- >
192
-
193
- </span>
194
- <span
195
- className={null}
196
- data-title={null}
197
- >
198
-
199
- </span>
200
- <span
201
- className={null}
202
- data-title={null}
203
- >
204
-
205
- </span>
206
- <span
207
- className={null}
208
- data-title={null}
209
- >
210
-
211
- </span>
212
- </div>
213
- `;
214
-
215
- exports[`UserTimeDiffFormat component Should display tomorrow key - greater than 24 hour 1`] = `
216
- <span
217
- className={null}
218
- data-title={null}
219
- >
220
- tomorrow
221
- </span>
222
- `;
223
-
224
- exports[`UserTimeDiffFormat component Should display tomorrow key - less than 24 hour 1`] = `
225
- <span
226
- className={null}
227
- data-title={null}
228
- >
229
- tomorrow
230
- </span>
231
- `;
232
-
233
- exports[`UserTimeDiffFormat component Should display tomorrow key - same time 1`] = `
234
- <span
235
- className={null}
236
- data-title={null}
237
- >
238
- tomorrow
239
- </span>
240
- `;
241
-
242
- exports[`UserTimeDiffFormat component Should display years and days 1`] = `
243
- <span
244
- className={null}
245
- data-title={null}
246
- >
247
-
248
- </span>
249
- `;
250
-
251
- exports[`UserTimeDiffFormat component Should display years and days1 1`] = `
252
- <span
253
- className={null}
254
- data-title={null}
255
- >
256
-
257
- </span>
258
- `;
259
-
260
- exports[`UserTimeDiffFormat component Should display yesterday - greater than 24 hour 1`] = `
261
- <span
262
- className={null}
263
- data-title={null}
264
- >
265
- yesterday
266
- </span>
267
- `;
268
-
269
- exports[`UserTimeDiffFormat component Should display yesterday - less than 24 hour 1`] = `
270
- <span
271
- className={null}
272
- data-title={null}
273
- >
274
- yesterday
275
- </span>
276
- `;
277
-
278
- exports[`UserTimeDiffFormat component Should display yesterday - with same time 1`] = `
279
- <span
280
- className={null}
281
- data-title={null}
282
- >
283
- yesterday
284
- </span>
285
- `;
286
-
287
- exports[`UserTimeDiffFormat component created time today 1`] = `
288
- <span
289
- className={null}
290
- data-title={null}
291
- >
292
- 12:25 PM
293
- </span>
294
- `;
295
-
296
- exports[`UserTimeDiffFormat component created time tomorrow 1`] = `
297
- <span
298
- className={null}
299
- data-title={null}
300
- >
301
- tommorrow 12:25 PM
302
- </span>
303
- `;
304
-
305
- exports[`UserTimeDiffFormat component created time within 7 days 1`] = `
306
- <span
307
- className={null}
308
- data-title={null}
309
- >
310
-
311
- </span>
312
- `;
313
-
314
- exports[`UserTimeDiffFormat component created time within pattern 1`] = `
315
- <span
316
- className={null}
317
- data-title={null}
318
- >
319
-
320
- </span>
321
- `;
322
-
323
- exports[`UserTimeDiffFormat component created time yesterday 1`] = `
324
- <span
325
- className={null}
326
- data-title={null}
327
- >
328
- yesterday 12:25 PM
329
- </span>
330
- `;
331
-
332
- exports[`UserTimeDiffFormat component task due date set - overdue 1`] = `
333
- <span
334
- className={null}
335
- data-title={null}
336
- >
337
-
338
- </span>
339
- `;
340
-
341
- exports[`UserTimeDiffFormat component task due date set - today [hh:mm:AM/PM] 1`] = `
342
- <span
343
- className={null}
344
- data-title="late by 364 days"
345
- >
346
- 25-10-2015
347
- </span>
348
- `;
349
-
350
- exports[`UserTimeDiffFormat component task due date set - tomorrow [hh:mm:AM/PM] 1`] = `
351
- <span
352
- className={null}
353
- data-title={null}
354
- >
355
- tommorrow 10:25 AM
356
- </span>
357
- `;
358
-
359
- exports[`UserTimeDiffFormat component task due date set - yesterday dd:MM:YYYY hh:mm:A 1`] = `
360
- <span
361
- className={null}
362
- data-title={null}
363
- >
364
- 24/10/2016 12:25 PM
365
- </span>
366
- `;
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`UserTimeDiffFormat component Should display other - greater time 1`] = `
4
+ <span
5
+ className={null}
6
+ data-title={null}
7
+ >
8
+ yesterday
9
+ </span>
10
+ `;
11
+
12
+ exports[`UserTimeDiffFormat component Should display other - less time 1`] = `
13
+ <span
14
+ className={null}
15
+ data-title={null}
16
+ >
17
+ less 7 23-10-2016
18
+ </span>
19
+ `;
20
+
21
+ exports[`UserTimeDiffFormat component Should display other - same time 1`] = `
22
+ <span
23
+ className={null}
24
+ data-title={null}
25
+ >
26
+ less 7 23-10-2016
27
+ </span>
28
+ `;
29
+
30
+ exports[`UserTimeDiffFormat component Should display other later- less time 1`] = `
31
+ <span
32
+ className={null}
33
+ data-title={null}
34
+ >
35
+ less 7 27-10-2016
36
+ </span>
37
+ `;
38
+
39
+ exports[`UserTimeDiffFormat component Should display other later- less time 2`] = `
40
+ <span
41
+ className={null}
42
+ data-title={null}
43
+ >
44
+ tomorrow
45
+ </span>
46
+ `;
47
+
48
+ exports[`UserTimeDiffFormat component Should display other later- same time 1`] = `
49
+ <span
50
+ className={null}
51
+ data-title={null}
52
+ >
53
+ less 7 27-10-2016
54
+ </span>
55
+ `;
56
+
57
+ exports[`UserTimeDiffFormat component Should display others 1`] = `
58
+ <span
59
+ className={null}
60
+ data-title={null}
61
+ >
62
+ less 7 27-11-2016
63
+ </span>
64
+ `;
65
+
66
+ exports[`UserTimeDiffFormat component Should display today ago - user 1`] = `
67
+ <span
68
+ className={null}
69
+ data-title={null}
70
+ >
71
+ 00:00:01 ago
72
+ </span>
73
+ `;
74
+
75
+ exports[`UserTimeDiffFormat component Should display today ago 1`] = `
76
+ <span
77
+ className={null}
78
+ data-title={null}
79
+ >
80
+ 00:00:01 later
81
+ </span>
82
+ `;
83
+
84
+ exports[`UserTimeDiffFormat component Should display today key - greater than 24 hour 1`] = `
85
+ <span
86
+ className={null}
87
+ data-title={null}
88
+ >
89
+ today.later
90
+ </span>
91
+ `;
92
+
93
+ exports[`UserTimeDiffFormat component Should display today key - less than 24 hour 1`] = `
94
+ <span
95
+ className={null}
96
+ data-title={null}
97
+ >
98
+ today.ago
99
+ </span>
100
+ `;
101
+
102
+ exports[`UserTimeDiffFormat component Should display today key - same time 1`] = `
103
+ <span
104
+ className={null}
105
+ data-title={null}
106
+ >
107
+ today
108
+ </span>
109
+ `;
110
+
111
+ exports[`UserTimeDiffFormat component Should display today key - user 1`] = `
112
+ <span
113
+ className={null}
114
+ data-title={null}
115
+ >
116
+ today
117
+ </span>
118
+ `;
119
+
120
+ exports[`UserTimeDiffFormat component Should display today later - user 1`] = `
121
+ <span
122
+ className={null}
123
+ data-title={null}
124
+ >
125
+ 00:00:01 later
126
+ </span>
127
+ `;
128
+
129
+ exports[`UserTimeDiffFormat component Should display today later 1`] = `
130
+ <span
131
+ className={null}
132
+ data-title={null}
133
+ >
134
+ 00:00:01 later
135
+ </span>
136
+ `;
137
+
138
+ exports[`UserTimeDiffFormat component Should display today1 1`] = `
139
+ <div>
140
+ <span
141
+ className={null}
142
+ data-title={null}
143
+ >
144
+
145
+ </span>
146
+ <span
147
+ className={null}
148
+ data-title={null}
149
+ >
150
+
151
+ </span>
152
+ <span
153
+ className={null}
154
+ data-title={null}
155
+ >
156
+
157
+ </span>
158
+ <span
159
+ className={null}
160
+ data-title={null}
161
+ >
162
+
163
+ </span>
164
+ <span
165
+ className={null}
166
+ data-title={null}
167
+ >
168
+
169
+ </span>
170
+ <span
171
+ className={null}
172
+ data-title={null}
173
+ >
174
+
175
+ </span>
176
+ <span
177
+ className={null}
178
+ data-title={null}
179
+ >
180
+
181
+ </span>
182
+ <span
183
+ className={null}
184
+ data-title={null}
185
+ >
186
+
187
+ </span>
188
+ <span
189
+ className={null}
190
+ data-title={null}
191
+ >
192
+
193
+ </span>
194
+ <span
195
+ className={null}
196
+ data-title={null}
197
+ >
198
+
199
+ </span>
200
+ <span
201
+ className={null}
202
+ data-title={null}
203
+ >
204
+
205
+ </span>
206
+ <span
207
+ className={null}
208
+ data-title={null}
209
+ >
210
+
211
+ </span>
212
+ </div>
213
+ `;
214
+
215
+ exports[`UserTimeDiffFormat component Should display tomorrow key - greater than 24 hour 1`] = `
216
+ <span
217
+ className={null}
218
+ data-title={null}
219
+ >
220
+ tomorrow
221
+ </span>
222
+ `;
223
+
224
+ exports[`UserTimeDiffFormat component Should display tomorrow key - less than 24 hour 1`] = `
225
+ <span
226
+ className={null}
227
+ data-title={null}
228
+ >
229
+ tomorrow
230
+ </span>
231
+ `;
232
+
233
+ exports[`UserTimeDiffFormat component Should display tomorrow key - same time 1`] = `
234
+ <span
235
+ className={null}
236
+ data-title={null}
237
+ >
238
+ tomorrow
239
+ </span>
240
+ `;
241
+
242
+ exports[`UserTimeDiffFormat component Should display years and days 1`] = `
243
+ <span
244
+ className={null}
245
+ data-title={null}
246
+ >
247
+
248
+ </span>
249
+ `;
250
+
251
+ exports[`UserTimeDiffFormat component Should display years and days1 1`] = `
252
+ <span
253
+ className={null}
254
+ data-title={null}
255
+ >
256
+
257
+ </span>
258
+ `;
259
+
260
+ exports[`UserTimeDiffFormat component Should display yesterday - greater than 24 hour 1`] = `
261
+ <span
262
+ className={null}
263
+ data-title={null}
264
+ >
265
+ yesterday
266
+ </span>
267
+ `;
268
+
269
+ exports[`UserTimeDiffFormat component Should display yesterday - less than 24 hour 1`] = `
270
+ <span
271
+ className={null}
272
+ data-title={null}
273
+ >
274
+ yesterday
275
+ </span>
276
+ `;
277
+
278
+ exports[`UserTimeDiffFormat component Should display yesterday - with same time 1`] = `
279
+ <span
280
+ className={null}
281
+ data-title={null}
282
+ >
283
+ yesterday
284
+ </span>
285
+ `;
286
+
287
+ exports[`UserTimeDiffFormat component created time today 1`] = `
288
+ <span
289
+ className={null}
290
+ data-title={null}
291
+ >
292
+ 12:25 PM
293
+ </span>
294
+ `;
295
+
296
+ exports[`UserTimeDiffFormat component created time tomorrow 1`] = `
297
+ <span
298
+ className={null}
299
+ data-title={null}
300
+ >
301
+ tommorrow 12:25 PM
302
+ </span>
303
+ `;
304
+
305
+ exports[`UserTimeDiffFormat component created time within 7 days 1`] = `
306
+ <span
307
+ className={null}
308
+ data-title={null}
309
+ >
310
+
311
+ </span>
312
+ `;
313
+
314
+ exports[`UserTimeDiffFormat component created time within pattern 1`] = `
315
+ <span
316
+ className={null}
317
+ data-title={null}
318
+ >
319
+
320
+ </span>
321
+ `;
322
+
323
+ exports[`UserTimeDiffFormat component created time yesterday 1`] = `
324
+ <span
325
+ className={null}
326
+ data-title={null}
327
+ >
328
+ yesterday 12:25 PM
329
+ </span>
330
+ `;
331
+
332
+ exports[`UserTimeDiffFormat component task due date set - overdue 1`] = `
333
+ <span
334
+ className={null}
335
+ data-title={null}
336
+ >
337
+
338
+ </span>
339
+ `;
340
+
341
+ exports[`UserTimeDiffFormat component task due date set - today [hh:mm:AM/PM] 1`] = `
342
+ <span
343
+ className={null}
344
+ data-title="late by 364 days"
345
+ >
346
+ 25-10-2015
347
+ </span>
348
+ `;
349
+
350
+ exports[`UserTimeDiffFormat component task due date set - tomorrow [hh:mm:AM/PM] 1`] = `
351
+ <span
352
+ className={null}
353
+ data-title={null}
354
+ >
355
+ tommorrow 10:25 AM
356
+ </span>
357
+ `;
358
+
359
+ exports[`UserTimeDiffFormat component task due date set - yesterday dd:MM:YYYY hh:mm:A 1`] = `
360
+ <span
361
+ className={null}
362
+ data-title={null}
363
+ >
364
+ 24/10/2016 12:25 PM
365
+ </span>
366
+ `;