@zohodesk/i18n 1.0.0-beta.15.1 → 1.0.0-beta.18
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.
- package/README.md +73 -41
- package/es/components/DateTimeDiffFormat.js +46 -12
- package/es/components/HOCI18N.js +33 -30
- package/es/components/I18NProvider.js +7 -16
- package/es/components/UserTimeDiffFormat.js +11 -9
- package/es/components/__tests__/DateTimeDiffFormat.spec.js +177 -136
- package/es/components/__tests__/FormatText.spec.js +0 -1
- package/es/components/__tests__/HOCI18N.spec.js +0 -1
- package/es/components/__tests__/I18N.spec.js +0 -2
- package/es/components/__tests__/I18NProvider.spec.js +0 -1
- package/es/components/__tests__/PluralFormat.spec.js +0 -1
- package/es/components/__tests__/UserTimeDiffFormat.spec.js +287 -206
- package/es/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
- package/es/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
- package/es/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
- package/es/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
- package/es/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
- package/es/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
- package/es/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
- package/es/index.js +2 -3
- package/es/utils.js +119 -171
- package/lib/components/DateTimeDiffFormat.js +49 -15
- package/lib/components/FormatText.js +4 -4
- package/lib/components/HOCI18N.js +4 -4
- package/lib/components/I18N.js +4 -4
- package/lib/components/I18NProvider.js +12 -21
- package/lib/components/PluralFormat.js +4 -4
- package/lib/components/UserTimeDiffFormat.js +12 -14
- package/lib/components/__tests__/I18NProvider.spec.js +1 -1
- package/lib/components/__tests__/UserTimeDiffFormat.spec.js +1 -1
- package/lib/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
- package/lib/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
- package/lib/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
- package/lib/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
- package/lib/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
- package/lib/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
- package/lib/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
- package/lib/index.js +54 -56
- package/lib/utils.js +130 -212
- package/package.json +28 -28
- package/src/I18NContext.js +2 -2
- package/src/components/DateTimeDiffFormat.js +254 -211
- package/src/components/FormatText.js +14 -14
- package/src/components/HOCI18N.js +37 -37
- package/src/components/I18N.js +72 -72
- package/src/components/I18NProvider.js +106 -116
- package/src/components/PluralFormat.js +37 -37
- package/src/components/UserTimeDiffFormat.js +94 -103
- package/src/components/__tests__/DateTimeDiffFormat.spec.js +618 -618
- package/src/components/__tests__/FormatText.spec.js +26 -26
- package/src/components/__tests__/HOCI18N.spec.js +33 -33
- package/src/components/__tests__/I18N.spec.js +29 -29
- package/src/components/__tests__/I18NProvider.spec.js +65 -65
- package/src/components/__tests__/PluralFormat.spec.js +27 -27
- package/src/components/__tests__/UserTimeDiffFormat.spec.js +1076 -1076
- package/src/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
- package/src/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
- package/src/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
- package/src/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
- package/src/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
- package/src/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
- package/src/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
- package/src/index.js +33 -33
- package/src/utils.js +527 -587
- package/es/components/NewDateFormat.js +0 -53
- package/lib/components/NewDateFormat.js +0 -60
- package/src/components/NewDateFormat.js +0 -60
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "core-js/modules/web.url.to-json";
|
|
2
1
|
import UserTimeDiffFormat from '../UserTimeDiffFormat';
|
|
3
2
|
import I18NProvider, { i18NProviderUtils } from '../I18NProvider';
|
|
4
3
|
import React from 'react';
|
|
@@ -44,12 +43,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
44
43
|
key: 'tomorrow',
|
|
45
44
|
params: ['hh', 'mm', 'ss']
|
|
46
45
|
},
|
|
47
|
-
others:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
others: _ref => {
|
|
47
|
+
let {
|
|
48
|
+
years,
|
|
49
|
+
days,
|
|
50
|
+
hours,
|
|
51
|
+
minutes
|
|
52
|
+
} = _ref;
|
|
53
|
+
return 'DD-MM-YYYY';
|
|
54
|
+
},
|
|
53
55
|
ago: "ago",
|
|
54
56
|
later: "later"
|
|
55
57
|
})));
|
|
@@ -78,12 +80,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
78
80
|
key: 'tomorrow',
|
|
79
81
|
params: ['hh', 'mm', 'ss']
|
|
80
82
|
},
|
|
81
|
-
others:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
others: _ref2 => {
|
|
84
|
+
let {
|
|
85
|
+
years,
|
|
86
|
+
days,
|
|
87
|
+
hours,
|
|
88
|
+
minutes
|
|
89
|
+
} = _ref2;
|
|
90
|
+
return 'DD-MM-YYYY';
|
|
91
|
+
},
|
|
87
92
|
ago: "ago",
|
|
88
93
|
later: "later"
|
|
89
94
|
})));
|
|
@@ -112,12 +117,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
112
117
|
key: 'tomorrow',
|
|
113
118
|
params: ['hh', 'mm', 'ss']
|
|
114
119
|
},
|
|
115
|
-
others:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
others: _ref3 => {
|
|
121
|
+
let {
|
|
122
|
+
years,
|
|
123
|
+
days,
|
|
124
|
+
hours,
|
|
125
|
+
minutes
|
|
126
|
+
} = _ref3;
|
|
127
|
+
return 'DD-MM-YYYY';
|
|
128
|
+
},
|
|
121
129
|
ago: "ago",
|
|
122
130
|
later: "later"
|
|
123
131
|
})));
|
|
@@ -146,12 +154,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
146
154
|
key: 'tomorrow',
|
|
147
155
|
params: ['hh', 'mm', 'ss']
|
|
148
156
|
},
|
|
149
|
-
others:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
157
|
+
others: _ref4 => {
|
|
158
|
+
let {
|
|
159
|
+
years,
|
|
160
|
+
days,
|
|
161
|
+
hours,
|
|
162
|
+
minutes
|
|
163
|
+
} = _ref4;
|
|
164
|
+
return 'DD-MM-YYYY';
|
|
165
|
+
},
|
|
155
166
|
ago: "ago",
|
|
156
167
|
later: "later"
|
|
157
168
|
})));
|
|
@@ -180,12 +191,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
180
191
|
key: 'tomorrow',
|
|
181
192
|
params: ['hh', 'mm', 'ss']
|
|
182
193
|
},
|
|
183
|
-
others:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
194
|
+
others: _ref5 => {
|
|
195
|
+
let {
|
|
196
|
+
years,
|
|
197
|
+
days,
|
|
198
|
+
hours,
|
|
199
|
+
minutes
|
|
200
|
+
} = _ref5;
|
|
201
|
+
return 'DD-MM-YYYY';
|
|
202
|
+
},
|
|
189
203
|
ago: "ago",
|
|
190
204
|
later: "later"
|
|
191
205
|
})));
|
|
@@ -214,12 +228,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
214
228
|
key: 'tomorrow',
|
|
215
229
|
params: ['hh', 'mm', 'ss']
|
|
216
230
|
},
|
|
217
|
-
others:
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
231
|
+
others: _ref6 => {
|
|
232
|
+
let {
|
|
233
|
+
years,
|
|
234
|
+
days,
|
|
235
|
+
hours,
|
|
236
|
+
minutes
|
|
237
|
+
} = _ref6;
|
|
238
|
+
return 'DD-MM-YYYY';
|
|
239
|
+
},
|
|
223
240
|
ago: "ago",
|
|
224
241
|
later: "later"
|
|
225
242
|
})));
|
|
@@ -248,12 +265,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
248
265
|
key: 'tomorrow',
|
|
249
266
|
params: ['hh', 'mm', 'ss']
|
|
250
267
|
},
|
|
251
|
-
others:
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
268
|
+
others: _ref7 => {
|
|
269
|
+
let {
|
|
270
|
+
years,
|
|
271
|
+
days,
|
|
272
|
+
hours,
|
|
273
|
+
minutes
|
|
274
|
+
} = _ref7;
|
|
275
|
+
return 'DD-MM-YYYY';
|
|
276
|
+
},
|
|
257
277
|
ago: "ago",
|
|
258
278
|
later: "later"
|
|
259
279
|
})));
|
|
@@ -282,12 +302,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
282
302
|
key: 'tomorrow',
|
|
283
303
|
params: ['hh', 'mm', 'ss']
|
|
284
304
|
},
|
|
285
|
-
others:
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
305
|
+
others: _ref8 => {
|
|
306
|
+
let {
|
|
307
|
+
years,
|
|
308
|
+
days,
|
|
309
|
+
hours,
|
|
310
|
+
minutes
|
|
311
|
+
} = _ref8;
|
|
312
|
+
return 'DD-MM-YYYY';
|
|
313
|
+
},
|
|
291
314
|
ago: "ago",
|
|
292
315
|
later: "later"
|
|
293
316
|
})));
|
|
@@ -316,12 +339,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
316
339
|
key: 'tomorrow',
|
|
317
340
|
params: ['hh', 'mm', 'ss']
|
|
318
341
|
},
|
|
319
|
-
others:
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
342
|
+
others: _ref9 => {
|
|
343
|
+
let {
|
|
344
|
+
years,
|
|
345
|
+
days,
|
|
346
|
+
hours,
|
|
347
|
+
minutes
|
|
348
|
+
} = _ref9;
|
|
349
|
+
return 'DD-MM-YYYY';
|
|
350
|
+
},
|
|
325
351
|
ago: "ago",
|
|
326
352
|
later: "later"
|
|
327
353
|
})));
|
|
@@ -350,13 +376,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
350
376
|
key: 'tomorrow',
|
|
351
377
|
params: ['hh', 'mm', 'ss']
|
|
352
378
|
},
|
|
353
|
-
others:
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
379
|
+
others: _ref10 => {
|
|
380
|
+
let {
|
|
381
|
+
years,
|
|
382
|
+
days,
|
|
383
|
+
hours,
|
|
384
|
+
minutes,
|
|
385
|
+
suffix
|
|
386
|
+
} = _ref10;
|
|
387
|
+
|
|
360
388
|
if (days > 7) {
|
|
361
389
|
return 'DD-MM-YYYY';
|
|
362
390
|
}
|
|
@@ -391,13 +419,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
391
419
|
key: 'tomorrow',
|
|
392
420
|
params: ['hh', 'mm', 'ss']
|
|
393
421
|
},
|
|
394
|
-
others:
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
422
|
+
others: _ref11 => {
|
|
423
|
+
let {
|
|
424
|
+
years,
|
|
425
|
+
days,
|
|
426
|
+
hours,
|
|
427
|
+
minutes,
|
|
428
|
+
suffix
|
|
429
|
+
} = _ref11;
|
|
430
|
+
|
|
401
431
|
if (days > 7) {
|
|
402
432
|
return 'DD-MM-YYYY';
|
|
403
433
|
}
|
|
@@ -432,13 +462,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
432
462
|
key: 'tomorrow',
|
|
433
463
|
params: ['hh', 'mm', 'ss']
|
|
434
464
|
},
|
|
435
|
-
others:
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
465
|
+
others: _ref12 => {
|
|
466
|
+
let {
|
|
467
|
+
years,
|
|
468
|
+
days,
|
|
469
|
+
hours,
|
|
470
|
+
minutes,
|
|
471
|
+
suffix
|
|
472
|
+
} = _ref12;
|
|
473
|
+
|
|
442
474
|
if (days > 7) {
|
|
443
475
|
return 'DD-MM-YYYY';
|
|
444
476
|
}
|
|
@@ -473,14 +505,16 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
473
505
|
key: 'tomorrow',
|
|
474
506
|
params: ['hh', 'mm', 'ss']
|
|
475
507
|
},
|
|
476
|
-
others:
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
508
|
+
others: _ref13 => {
|
|
509
|
+
let {
|
|
510
|
+
years,
|
|
511
|
+
days,
|
|
512
|
+
hours,
|
|
513
|
+
minutes,
|
|
514
|
+
suffix,
|
|
515
|
+
isWithInAWeek
|
|
516
|
+
} = _ref13;
|
|
517
|
+
|
|
484
518
|
if (days > 7) {
|
|
485
519
|
return 'DD-MM-YYYY';
|
|
486
520
|
}
|
|
@@ -515,13 +549,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
515
549
|
key: 'tomorrow',
|
|
516
550
|
params: ['hh', 'mm', 'ss']
|
|
517
551
|
},
|
|
518
|
-
others:
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
552
|
+
others: _ref14 => {
|
|
553
|
+
let {
|
|
554
|
+
years,
|
|
555
|
+
days,
|
|
556
|
+
hours,
|
|
557
|
+
minutes,
|
|
558
|
+
suffix
|
|
559
|
+
} = _ref14;
|
|
560
|
+
|
|
525
561
|
if (days > 7) {
|
|
526
562
|
return 'DD-MM-YYYY';
|
|
527
563
|
}
|
|
@@ -556,13 +592,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
556
592
|
key: 'tomorrow',
|
|
557
593
|
params: ['hh', 'mm', 'ss']
|
|
558
594
|
},
|
|
559
|
-
others:
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
595
|
+
others: _ref15 => {
|
|
596
|
+
let {
|
|
597
|
+
years,
|
|
598
|
+
days,
|
|
599
|
+
hours,
|
|
600
|
+
minutes,
|
|
601
|
+
suffix
|
|
602
|
+
} = _ref15;
|
|
603
|
+
|
|
566
604
|
if (days > 7) {
|
|
567
605
|
return 'DD-MM-YYYY';
|
|
568
606
|
}
|
|
@@ -597,14 +635,16 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
597
635
|
key: 'tomorrow',
|
|
598
636
|
params: ['hh', 'mm', 'ss']
|
|
599
637
|
},
|
|
600
|
-
others:
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
638
|
+
others: _ref16 => {
|
|
639
|
+
let {
|
|
640
|
+
years,
|
|
641
|
+
days,
|
|
642
|
+
hours,
|
|
643
|
+
minutes,
|
|
644
|
+
suffix,
|
|
645
|
+
isWithInAWeek
|
|
646
|
+
} = _ref16;
|
|
647
|
+
|
|
608
648
|
if (days > 7) {
|
|
609
649
|
return 'DD-MM-YYYY';
|
|
610
650
|
}
|
|
@@ -634,12 +674,14 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
634
674
|
key: i,
|
|
635
675
|
to: to,
|
|
636
676
|
toTimeZone: "Asia/Kolkata",
|
|
637
|
-
format: ({
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
677
|
+
format: (_ref17, pattern) => {
|
|
678
|
+
let {
|
|
679
|
+
years,
|
|
680
|
+
days,
|
|
681
|
+
months,
|
|
682
|
+
hours
|
|
683
|
+
} = _ref17;
|
|
684
|
+
|
|
643
685
|
switch (pattern) {
|
|
644
686
|
case '000000':
|
|
645
687
|
case '000001':
|
|
@@ -707,12 +749,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
707
749
|
key: 'tomorrow',
|
|
708
750
|
params: ['hh', 'mm', 'ss']
|
|
709
751
|
},
|
|
710
|
-
others:
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
752
|
+
others: _ref18 => {
|
|
753
|
+
let {
|
|
754
|
+
years,
|
|
755
|
+
days,
|
|
756
|
+
hours,
|
|
757
|
+
minutes
|
|
758
|
+
} = _ref18;
|
|
759
|
+
return 'DD-MM-YYYY';
|
|
760
|
+
},
|
|
716
761
|
ago: "ago",
|
|
717
762
|
later: "later"
|
|
718
763
|
})));
|
|
@@ -744,12 +789,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
744
789
|
key: 'tomorrow',
|
|
745
790
|
params: ['hh', 'mm', 'ss']
|
|
746
791
|
},
|
|
747
|
-
others:
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
792
|
+
others: _ref19 => {
|
|
793
|
+
let {
|
|
794
|
+
years,
|
|
795
|
+
days,
|
|
796
|
+
hours,
|
|
797
|
+
minutes
|
|
798
|
+
} = _ref19;
|
|
799
|
+
return 'DD-MM-YYYY';
|
|
800
|
+
},
|
|
753
801
|
ago: "ago",
|
|
754
802
|
later: "later"
|
|
755
803
|
})));
|
|
@@ -767,12 +815,14 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
767
815
|
from: "2017-10-25T05:55:28.000Z",
|
|
768
816
|
to: "2015-08-25T05:55:28.000Z",
|
|
769
817
|
toTimeZone: "Asia/Kolkata",
|
|
770
|
-
format: ({
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
818
|
+
format: (_ref20, pattern) => {
|
|
819
|
+
let {
|
|
820
|
+
years,
|
|
821
|
+
days,
|
|
822
|
+
months,
|
|
823
|
+
hours
|
|
824
|
+
} = _ref20;
|
|
825
|
+
|
|
776
826
|
if (years > 1) {
|
|
777
827
|
return {
|
|
778
828
|
key: 'nyear.ndays',
|
|
@@ -797,12 +847,14 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
797
847
|
from: "2015-08-25T05:55:28.000Z",
|
|
798
848
|
to: "2017-10-25T05:55:28.000Z",
|
|
799
849
|
toTimeZone: "Asia/Kolkata",
|
|
800
|
-
format: ({
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
850
|
+
format: (_ref21, pattern) => {
|
|
851
|
+
let {
|
|
852
|
+
years,
|
|
853
|
+
days,
|
|
854
|
+
months,
|
|
855
|
+
hours
|
|
856
|
+
} = _ref21;
|
|
857
|
+
|
|
806
858
|
if (years > 1) {
|
|
807
859
|
return {
|
|
808
860
|
key: 'nyear.ndays',
|
|
@@ -837,12 +889,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
837
889
|
key: 'tomorrow',
|
|
838
890
|
params: ['hh', 'mm', 'ss']
|
|
839
891
|
},
|
|
840
|
-
others:
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
892
|
+
others: _ref22 => {
|
|
893
|
+
let {
|
|
894
|
+
years,
|
|
895
|
+
days,
|
|
896
|
+
hours,
|
|
897
|
+
minutes
|
|
898
|
+
} = _ref22;
|
|
899
|
+
return 'DD-MM-YYYY';
|
|
900
|
+
},
|
|
846
901
|
ago: "ago",
|
|
847
902
|
later: "later"
|
|
848
903
|
})));
|
|
@@ -871,12 +926,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
871
926
|
key: 'tomorrow',
|
|
872
927
|
params: ['hh', 'mm', 'ss']
|
|
873
928
|
},
|
|
874
|
-
others:
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
929
|
+
others: _ref23 => {
|
|
930
|
+
let {
|
|
931
|
+
years,
|
|
932
|
+
days,
|
|
933
|
+
hours,
|
|
934
|
+
minutes
|
|
935
|
+
} = _ref23;
|
|
936
|
+
return 'DD-MM-YYYY';
|
|
937
|
+
},
|
|
880
938
|
ago: "ago",
|
|
881
939
|
later: "later"
|
|
882
940
|
})));
|
|
@@ -906,12 +964,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
906
964
|
key: 'tomorrow',
|
|
907
965
|
params: ['hh', 'mm', 'ss']
|
|
908
966
|
},
|
|
909
|
-
others:
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
967
|
+
others: _ref24 => {
|
|
968
|
+
let {
|
|
969
|
+
years,
|
|
970
|
+
days,
|
|
971
|
+
hours,
|
|
972
|
+
minutes
|
|
973
|
+
} = _ref24;
|
|
974
|
+
return 'DD-MM-YYYY';
|
|
975
|
+
},
|
|
915
976
|
ago: "ago",
|
|
916
977
|
later: "later"
|
|
917
978
|
})));
|
|
@@ -954,12 +1015,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
954
1015
|
today: '[today] hh:mm A',
|
|
955
1016
|
yesterday: 'dd:MM:YYYY hh:mm A',
|
|
956
1017
|
tomorrow: '[tommorrow] hh:mm A',
|
|
957
|
-
others:
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
1018
|
+
others: _ref25 => {
|
|
1019
|
+
let {
|
|
1020
|
+
years,
|
|
1021
|
+
days,
|
|
1022
|
+
hours,
|
|
1023
|
+
minutes
|
|
1024
|
+
} = _ref25;
|
|
1025
|
+
return 'DD-MM-YYYY';
|
|
1026
|
+
},
|
|
963
1027
|
ago: "ago",
|
|
964
1028
|
later: "later",
|
|
965
1029
|
title: i18NProviderUtils.userDateFormat('2015-10-27T05:55:28.000Z', {}, '', 'later', true, (diffObj, pattern) => {
|
|
@@ -1123,12 +1187,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
1123
1187
|
today: '[today] hh:mm A',
|
|
1124
1188
|
yesterday: 'dd:MM:YYYY hh:mm A',
|
|
1125
1189
|
tomorrow: '[tommorrow] hh:mm A',
|
|
1126
|
-
others:
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1190
|
+
others: _ref26 => {
|
|
1191
|
+
let {
|
|
1192
|
+
years,
|
|
1193
|
+
days,
|
|
1194
|
+
hours,
|
|
1195
|
+
minutes
|
|
1196
|
+
} = _ref26;
|
|
1197
|
+
return 'DD-MM-YYYY';
|
|
1198
|
+
},
|
|
1132
1199
|
ago: "ago",
|
|
1133
1200
|
later: "later"
|
|
1134
1201
|
})));
|
|
@@ -1148,12 +1215,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
1148
1215
|
today: '[today] hh:mm A',
|
|
1149
1216
|
yesterday: 'DD/MM/YYYY hh:mm A',
|
|
1150
1217
|
tomorrow: '[tommorrow] hh:mm A',
|
|
1151
|
-
others:
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1218
|
+
others: _ref27 => {
|
|
1219
|
+
let {
|
|
1220
|
+
years,
|
|
1221
|
+
days,
|
|
1222
|
+
hours,
|
|
1223
|
+
minutes
|
|
1224
|
+
} = _ref27;
|
|
1225
|
+
return 'DD-MM-YYYY';
|
|
1226
|
+
},
|
|
1157
1227
|
ago: "ago",
|
|
1158
1228
|
later: "later"
|
|
1159
1229
|
})));
|
|
@@ -1212,12 +1282,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
1212
1282
|
today: 'hh:mm A',
|
|
1213
1283
|
yesterday: 'DD/MM/YYYY hh:mm A',
|
|
1214
1284
|
tomorrow: '[tommorrow] hh:mm A',
|
|
1215
|
-
others:
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1285
|
+
others: _ref28 => {
|
|
1286
|
+
let {
|
|
1287
|
+
years,
|
|
1288
|
+
days,
|
|
1289
|
+
hours,
|
|
1290
|
+
minutes
|
|
1291
|
+
} = _ref28;
|
|
1292
|
+
return 'DD-MM-YYYY';
|
|
1293
|
+
},
|
|
1221
1294
|
ago: "ago",
|
|
1222
1295
|
later: "later"
|
|
1223
1296
|
})));
|
|
@@ -1235,12 +1308,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
1235
1308
|
today: 'hh:mm A',
|
|
1236
1309
|
yesterday: '[yesterday] hh:mm A',
|
|
1237
1310
|
tomorrow: '[tommorrow] hh:mm A',
|
|
1238
|
-
others:
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1311
|
+
others: _ref29 => {
|
|
1312
|
+
let {
|
|
1313
|
+
years,
|
|
1314
|
+
days,
|
|
1315
|
+
hours,
|
|
1316
|
+
minutes
|
|
1317
|
+
} = _ref29;
|
|
1318
|
+
return 'DD-MM-YYYY';
|
|
1319
|
+
},
|
|
1244
1320
|
ago: "ago",
|
|
1245
1321
|
later: "later"
|
|
1246
1322
|
})));
|
|
@@ -1258,12 +1334,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
1258
1334
|
today: 'hh:mm A',
|
|
1259
1335
|
yesterday: '[yesterday] hh:mm A',
|
|
1260
1336
|
tomorrow: '[tommorrow] hh:mm A',
|
|
1261
|
-
others:
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1337
|
+
others: _ref30 => {
|
|
1338
|
+
let {
|
|
1339
|
+
years,
|
|
1340
|
+
days,
|
|
1341
|
+
hours,
|
|
1342
|
+
minutes
|
|
1343
|
+
} = _ref30;
|
|
1344
|
+
return 'DD-MM-YYYY';
|
|
1345
|
+
},
|
|
1267
1346
|
ago: "ago",
|
|
1268
1347
|
later: "later"
|
|
1269
1348
|
})));
|
|
@@ -1283,14 +1362,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
1283
1362
|
today: 'hh:mm A',
|
|
1284
1363
|
yesterday: '[yesterday] hh:mm A',
|
|
1285
1364
|
tomorrow: '[tommorrow] hh:mm A',
|
|
1286
|
-
others:
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1365
|
+
others: _ref31 => {
|
|
1366
|
+
let {
|
|
1367
|
+
years,
|
|
1368
|
+
months,
|
|
1369
|
+
days,
|
|
1370
|
+
hours,
|
|
1371
|
+
minutes,
|
|
1372
|
+
yDays
|
|
1373
|
+
} = _ref31;
|
|
1294
1374
|
years = years > 1 ? '2' : years; // months = diffObj1.months > 1 ? '2' : diffObj1.months;
|
|
1295
1375
|
//days = diffObj1.days > 1 ? '2' : diffObj1.days;
|
|
1296
1376
|
|
|
@@ -1359,14 +1439,15 @@ describe('UserTimeDiffFormat component', () => {
|
|
|
1359
1439
|
timeZone: "Asia/Kolkata"
|
|
1360
1440
|
}, /*#__PURE__*/React.createElement(UserTimeDiffFormat, {
|
|
1361
1441
|
to: "2016-10-19T06:55:28.000Z",
|
|
1362
|
-
format: ({
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1442
|
+
format: (_ref32, pattern) => {
|
|
1443
|
+
let {
|
|
1444
|
+
years,
|
|
1445
|
+
months,
|
|
1446
|
+
days,
|
|
1447
|
+
hours,
|
|
1448
|
+
minutes,
|
|
1449
|
+
yDays
|
|
1450
|
+
} = _ref32;
|
|
1370
1451
|
let getDateI18NString = {
|
|
1371
1452
|
'0000': 'support.label.just.now',
|
|
1372
1453
|
'0001': 'support.1minute',
|