@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.
Files changed (67) hide show
  1. package/README.md +73 -41
  2. package/es/components/DateTimeDiffFormat.js +46 -12
  3. package/es/components/HOCI18N.js +33 -30
  4. package/es/components/I18NProvider.js +7 -16
  5. package/es/components/UserTimeDiffFormat.js +11 -9
  6. package/es/components/__tests__/DateTimeDiffFormat.spec.js +177 -136
  7. package/es/components/__tests__/FormatText.spec.js +0 -1
  8. package/es/components/__tests__/HOCI18N.spec.js +0 -1
  9. package/es/components/__tests__/I18N.spec.js +0 -2
  10. package/es/components/__tests__/I18NProvider.spec.js +0 -1
  11. package/es/components/__tests__/PluralFormat.spec.js +0 -1
  12. package/es/components/__tests__/UserTimeDiffFormat.spec.js +287 -206
  13. package/es/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
  14. package/es/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
  15. package/es/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
  16. package/es/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
  17. package/es/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
  18. package/es/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
  19. package/es/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
  20. package/es/index.js +2 -3
  21. package/es/utils.js +119 -171
  22. package/lib/components/DateTimeDiffFormat.js +49 -15
  23. package/lib/components/FormatText.js +4 -4
  24. package/lib/components/HOCI18N.js +4 -4
  25. package/lib/components/I18N.js +4 -4
  26. package/lib/components/I18NProvider.js +12 -21
  27. package/lib/components/PluralFormat.js +4 -4
  28. package/lib/components/UserTimeDiffFormat.js +12 -14
  29. package/lib/components/__tests__/I18NProvider.spec.js +1 -1
  30. package/lib/components/__tests__/UserTimeDiffFormat.spec.js +1 -1
  31. package/lib/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
  32. package/lib/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
  33. package/lib/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
  34. package/lib/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
  35. package/lib/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
  36. package/lib/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
  37. package/lib/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
  38. package/lib/index.js +54 -56
  39. package/lib/utils.js +130 -212
  40. package/package.json +28 -28
  41. package/src/I18NContext.js +2 -2
  42. package/src/components/DateTimeDiffFormat.js +254 -211
  43. package/src/components/FormatText.js +14 -14
  44. package/src/components/HOCI18N.js +37 -37
  45. package/src/components/I18N.js +72 -72
  46. package/src/components/I18NProvider.js +106 -116
  47. package/src/components/PluralFormat.js +37 -37
  48. package/src/components/UserTimeDiffFormat.js +94 -103
  49. package/src/components/__tests__/DateTimeDiffFormat.spec.js +618 -618
  50. package/src/components/__tests__/FormatText.spec.js +26 -26
  51. package/src/components/__tests__/HOCI18N.spec.js +33 -33
  52. package/src/components/__tests__/I18N.spec.js +29 -29
  53. package/src/components/__tests__/I18NProvider.spec.js +65 -65
  54. package/src/components/__tests__/PluralFormat.spec.js +27 -27
  55. package/src/components/__tests__/UserTimeDiffFormat.spec.js +1076 -1076
  56. package/src/components/__tests__/__snapshots__/DateTimeDiffFormat.spec.js.snap +258 -258
  57. package/src/components/__tests__/__snapshots__/FormatText.spec.js.snap +17 -17
  58. package/src/components/__tests__/__snapshots__/HOCI18N.spec.js.snap +15 -15
  59. package/src/components/__tests__/__snapshots__/I18N.spec.js.snap +17 -17
  60. package/src/components/__tests__/__snapshots__/I18NProvider.spec.js.snap +13 -13
  61. package/src/components/__tests__/__snapshots__/PluralFormat.spec.js.snap +17 -17
  62. package/src/components/__tests__/__snapshots__/UserTimeDiffFormat.spec.js.snap +366 -366
  63. package/src/index.js +33 -33
  64. package/src/utils.js +527 -587
  65. package/es/components/NewDateFormat.js +0 -53
  66. package/lib/components/NewDateFormat.js +0 -60
  67. 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
- years,
49
- days,
50
- hours,
51
- minutes
52
- }) => 'DD-MM-YYYY',
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
- years,
83
- days,
84
- hours,
85
- minutes
86
- }) => 'DD-MM-YYYY',
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
- years,
117
- days,
118
- hours,
119
- minutes
120
- }) => 'DD-MM-YYYY',
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
- years,
151
- days,
152
- hours,
153
- minutes
154
- }) => 'DD-MM-YYYY',
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
- years,
185
- days,
186
- hours,
187
- minutes
188
- }) => 'DD-MM-YYYY',
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
- years,
219
- days,
220
- hours,
221
- minutes
222
- }) => 'DD-MM-YYYY',
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
- years,
253
- days,
254
- hours,
255
- minutes
256
- }) => 'DD-MM-YYYY',
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
- years,
287
- days,
288
- hours,
289
- minutes
290
- }) => 'DD-MM-YYYY',
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
- years,
321
- days,
322
- hours,
323
- minutes
324
- }) => 'DD-MM-YYYY',
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
- years,
355
- days,
356
- hours,
357
- minutes,
358
- suffix
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
- years,
396
- days,
397
- hours,
398
- minutes,
399
- suffix
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
- years,
437
- days,
438
- hours,
439
- minutes,
440
- suffix
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
- years,
478
- days,
479
- hours,
480
- minutes,
481
- suffix,
482
- isWithInAWeek
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
- years,
520
- days,
521
- hours,
522
- minutes,
523
- suffix
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
- years,
561
- days,
562
- hours,
563
- minutes,
564
- suffix
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
- years,
602
- days,
603
- hours,
604
- minutes,
605
- suffix,
606
- isWithInAWeek
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
- years,
639
- days,
640
- months,
641
- hours
642
- }, pattern) => {
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
- years,
712
- days,
713
- hours,
714
- minutes
715
- }) => 'DD-MM-YYYY',
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
- years,
749
- days,
750
- hours,
751
- minutes
752
- }) => 'DD-MM-YYYY',
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
- years,
772
- days,
773
- months,
774
- hours
775
- }, pattern) => {
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
- years,
802
- days,
803
- months,
804
- hours
805
- }, pattern) => {
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
- years,
842
- days,
843
- hours,
844
- minutes
845
- }) => 'DD-MM-YYYY',
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
- years,
876
- days,
877
- hours,
878
- minutes
879
- }) => 'DD-MM-YYYY',
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
- years,
911
- days,
912
- hours,
913
- minutes
914
- }) => 'DD-MM-YYYY',
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
- years,
959
- days,
960
- hours,
961
- minutes
962
- }) => 'DD-MM-YYYY',
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
- years,
1128
- days,
1129
- hours,
1130
- minutes
1131
- }) => 'DD-MM-YYYY',
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
- years,
1153
- days,
1154
- hours,
1155
- minutes
1156
- }) => 'DD-MM-YYYY',
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
- years,
1217
- days,
1218
- hours,
1219
- minutes
1220
- }) => 'DD-MM-YYYY',
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
- years,
1240
- days,
1241
- hours,
1242
- minutes
1243
- }) => 'DD-MM-YYYY',
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
- years,
1263
- days,
1264
- hours,
1265
- minutes
1266
- }) => 'DD-MM-YYYY',
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
- years,
1288
- months,
1289
- days,
1290
- hours,
1291
- minutes,
1292
- yDays
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
- years,
1364
- months,
1365
- days,
1366
- hours,
1367
- minutes,
1368
- yDays
1369
- }, pattern) => {
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',