ps-toolkit-ui 1.20.87 → 1.20.89

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.
@@ -1473,42 +1473,65 @@
1473
1473
  };
1474
1474
  HelperClass.getDateRemainFull = function (l, dt, c) {
1475
1475
  if (c === void 0) { c = 2; }
1476
+ var now = new Date();
1476
1477
  var d = parseInt(dt.substring(6, dt.length - 2), 10);
1477
- var now = moment.now();
1478
+ var target = new Date(d);
1478
1479
  var r = '';
1479
- var dif = (d - now) / 1000;
1480
- var f = dif <= 0;
1481
- if (dif <= 0) {
1480
+ var f = now > target;
1481
+ if (f) {
1482
1482
  r += l('Finished') + ' - ';
1483
- dif = dif * -1;
1484
- }
1485
- var year = Math.floor(dif / 31536000);
1486
- var month = Math.floor((dif % 31536000) / 2628000);
1487
- var day = Math.floor(((dif % 31536000) % 2628000) / 86400);
1488
- var hour = Math.floor((((dif % 31536000) % 2628000) % 86400) / 3600);
1489
- var minute = Math.floor(((((dif % 31536000) % 2628000) % 86400) % 3600) / 60);
1490
- if (year > 0) {
1491
- r += l('YearP', year.toString());
1483
+ var tmp = target;
1484
+ target = now;
1485
+ now = tmp;
1486
+ }
1487
+ var years = target.getFullYear() - now.getFullYear();
1488
+ var months = target.getMonth() - now.getMonth();
1489
+ var days = target.getDate() - now.getDate();
1490
+ var hours = target.getHours() - now.getHours();
1491
+ var minutes = target.getMinutes() - now.getMinutes();
1492
+ var seconds = target.getSeconds() - now.getSeconds();
1493
+ if (seconds < 0) {
1494
+ minutes--;
1495
+ }
1496
+ if (minutes < 0) {
1497
+ minutes += 60;
1498
+ hours--;
1499
+ }
1500
+ if (hours < 0) {
1501
+ hours += 24;
1502
+ days--;
1503
+ }
1504
+ if (days < 0) {
1505
+ var prevMonth = new Date(target.getFullYear(), target.getMonth(), 0);
1506
+ days += prevMonth.getDate();
1507
+ months--;
1508
+ }
1509
+ if (months < 0) {
1510
+ months += 12;
1511
+ years--;
1512
+ }
1513
+ if (years > 0) {
1514
+ r += l('YearP', years.toString());
1492
1515
  c--;
1493
1516
  }
1494
- if (month > 0 && c > 0) {
1495
- r += year > 0 ? l('And') : '';
1496
- r += l('MonthP', month.toString());
1517
+ if (months > 0 && c > 0) {
1518
+ r += years > 0 ? l('And') : '';
1519
+ r += l('MonthP', months.toString());
1497
1520
  c--;
1498
1521
  }
1499
- if (day > 0 && c > 0) {
1500
- r += year > 0 || month > 0 ? l('And') : '';
1501
- r += l('DayP', day.toString());
1522
+ if (days > 0 && c > 0) {
1523
+ r += years > 0 || months > 0 ? l('And') : '';
1524
+ r += l('DayP', days.toString());
1502
1525
  c--;
1503
1526
  }
1504
- if (hour > 0 && c > 0) {
1505
- r += year > 0 || month > 0 || day > 0 ? l('And') : '';
1506
- r += l('HourP', hour.toString());
1527
+ if (hours > 0 && c > 0) {
1528
+ r += years > 0 || months > 0 || days > 0 ? l('And') : '';
1529
+ r += l('HourP', hours.toString());
1507
1530
  c--;
1508
1531
  }
1509
- if (minute > 0 && c > 0) {
1510
- r += year > 0 || month > 0 || day > 0 || hour > 0 ? l('And') : '';
1511
- r += l('MinuteP', minute.toString());
1532
+ if (minutes > 0 && c > 0) {
1533
+ r += years > 0 || months > 0 || days > 0 || hours > 0 ? l('And') : '';
1534
+ r += l('MinuteP', minutes.toString());
1512
1535
  c--;
1513
1536
  }
1514
1537
  r += (r !== '' ? '' : l('LessThanMinute')) + ' ' + (f ? l('Ago') : l('Later'));
@@ -6304,7 +6327,7 @@
6304
6327
  if (this.inp.onChange) {
6305
6328
  this.inp.onChange(this.inp, false);
6306
6329
  }
6307
- if (this.inp.type === exports.InputType.SelectSearch) {
6330
+ if (this.inp.type === exports.InputType.SelectSearch || this.inp.type === exports.InputType.SelectSearchRadio) {
6308
6331
  this.setOptions();
6309
6332
  }
6310
6333
  else if (e.target.value) {