@sswroom/sswr 1.6.1 → 1.6.2

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 (3) hide show
  1. package/Changelog +3 -0
  2. package/data.js +6 -5
  3. package/package.json +1 -1
package/Changelog CHANGED
@@ -1,3 +1,6 @@
1
+ 1.6.2
2
+ -Fixed data.DateTimeUtil.totalDays2DateValue bigint problem
3
+
1
4
  1.6.1
2
5
  -Fixed parser: parseJpg and parseWebp problem
3
6
  -Modified data.Timestamp.fromStr to return null if error
package/data.js CHANGED
@@ -542,6 +542,7 @@ export class DateTimeUtil
542
542
 
543
543
  static totalDays2DateValue(totalDays, t)
544
544
  {
545
+ totalDays = BigInt(totalDays);
545
546
  if (totalDays < 0)
546
547
  {
547
548
  t.year = 1970;
@@ -550,11 +551,11 @@ export class DateTimeUtil
550
551
  t.year--;
551
552
  if (DateTimeUtil.isYearLeap(t.year))
552
553
  {
553
- totalDays += 366;
554
+ totalDays += 366n;
554
555
  }
555
556
  else
556
557
  {
557
- totalDays += 365;
558
+ totalDays += 365n;
558
559
  }
559
560
  }
560
561
  }
@@ -572,7 +573,7 @@ export class DateTimeUtil
572
573
  else
573
574
  {
574
575
  t.year++;
575
- totalDays -= 366;
576
+ totalDays -= 366n;
576
577
  }
577
578
  }
578
579
  else
@@ -584,7 +585,7 @@ export class DateTimeUtil
584
585
  else
585
586
  {
586
587
  t.year++;
587
- totalDays -= 365;
588
+ totalDays -= 365n;
588
589
  }
589
590
  }
590
591
  }
@@ -1689,7 +1690,7 @@ export class LocalDate
1689
1690
  }
1690
1691
  else
1691
1692
  {
1692
- this.dateVal = year - 0;
1693
+ this.dateVal = year;
1693
1694
  }
1694
1695
  }
1695
1696
  else if (t == "DateValue" || t == "TimeValue")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sswroom/sswr",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "Libraries made by sswroom",
5
5
  "main": "sswr.js",
6
6
  "scripts": {