ps-toolkit-ui 1.15.2 → 1.15.4

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.
@@ -264,6 +264,9 @@
264
264
  Month11: 'بهمن',
265
265
  Month12: 'اسفند',
266
266
  Day: 'روز',
267
+ YearP: '{} سال',
268
+ MonthP: '{} ماه',
269
+ DayP: '{} روز',
267
270
  HourP: '{} ساعت',
268
271
  MinuteP: '{} دقیقه',
269
272
  Hour: 'ساعت',
@@ -1476,6 +1479,37 @@
1476
1479
  .replace(/Later/g, l('Later'))
1477
1480
  .replace(/Ago/g, l('Ago'));
1478
1481
  };
1482
+ HelperClass.GetRemainDate = function (l, ts) {
1483
+ if (ts.Tiks <= 0) {
1484
+ return l('Finished');
1485
+ }
1486
+ var c = 0;
1487
+ var result = '';
1488
+ if (ts.Years > 0) {
1489
+ result += l('YearP', ts.Years);
1490
+ c++;
1491
+ }
1492
+ if (ts.Months > 0) {
1493
+ result += c > 0 ? l('And') : '';
1494
+ result += l('MonthP', ts.Months);
1495
+ c++;
1496
+ }
1497
+ if (c < 2 && ts.Days > 0) {
1498
+ result += c > 0 ? l('And') : '';
1499
+ result += l('DayP', ts.Days);
1500
+ c++;
1501
+ }
1502
+ if (c < 2 && ts.Hours > 0) {
1503
+ result += c > 0 ? l('And') : '';
1504
+ result += l('HourP', ts.Hours);
1505
+ }
1506
+ if (c < 2 && ts.Minutes > 0) {
1507
+ result += c > 0 ? l('And') : '';
1508
+ result += l('MinuteP', ts.Minutes);
1509
+ }
1510
+ result += result !== '' ? ' ' + l('Later') : l('LessThanMinute');
1511
+ return result;
1512
+ };
1479
1513
  HelperClass.clone = function (v) {
1480
1514
  if (v == null) {
1481
1515
  return;