ps-toolkit-ui 1.15.3 → 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,8 @@
264
264
  Month11: 'بهمن',
265
265
  Month12: 'اسفند',
266
266
  Day: 'روز',
267
+ YearP: '{} سال',
268
+ MonthP: '{} ماه',
267
269
  DayP: '{} روز',
268
270
  HourP: '{} ساعت',
269
271
  MinuteP: '{} دقیقه',
@@ -1477,28 +1479,33 @@
1477
1479
  .replace(/Later/g, l('Later'))
1478
1480
  .replace(/Ago/g, l('Ago'));
1479
1481
  };
1480
- HelperClass.GetRemainDate = function (l, ss) {
1481
- if (ss <= 0) {
1482
+ HelperClass.GetRemainDate = function (l, ts) {
1483
+ if (ts.Tiks <= 0) {
1482
1484
  return l('Finished');
1483
1485
  }
1484
- var d = Math.floor(ss / (3600 * 24));
1485
- var h = Math.floor(ss % (3600 * 24) / 3600);
1486
- var m = Math.floor(ss % 3600 / 60);
1487
- var s = Math.floor(ss % 60);
1488
1486
  var c = 0;
1489
1487
  var result = '';
1490
- if (d > 0) {
1491
- result += l('DayP', d);
1488
+ if (ts.Years > 0) {
1489
+ result += l('YearP', ts.Years);
1492
1490
  c++;
1493
1491
  }
1494
- if (h > 0) {
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) {
1495
1498
  result += c > 0 ? l('And') : '';
1496
- result += l('HourP', h);
1499
+ result += l('DayP', ts.Days);
1497
1500
  c++;
1498
1501
  }
1499
- if (c < 2 && m > 0) {
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) {
1500
1507
  result += c > 0 ? l('And') : '';
1501
- result += l('MinuteP', m);
1508
+ result += l('MinuteP', ts.Minutes);
1502
1509
  }
1503
1510
  result += result !== '' ? ' ' + l('Later') : l('LessThanMinute');
1504
1511
  return result;