@internationalized/date 3.5.3-nightly.4516 → 3.5.3-nightly.4523
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.
- package/dist/import.mjs +29 -24
- package/dist/main.js +29 -24
- package/dist/main.js.map +1 -1
- package/dist/module.js +29 -24
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/calendars/PersianCalendar.ts +32 -40
package/dist/import.mjs
CHANGED
|
@@ -1760,33 +1760,37 @@ function $5f31bd6f0c8940b2$var$toGregorian(date) {
|
|
|
1760
1760
|
// Original licensing can be found in the NOTICE file in the root directory of this source tree.
|
|
1761
1761
|
|
|
1762
1762
|
|
|
1763
|
-
const $f3ed2e4472ae7e25$var$PERSIAN_EPOCH =
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1763
|
+
const $f3ed2e4472ae7e25$var$PERSIAN_EPOCH = 1948320;
|
|
1764
|
+
// Number of days from the start of the year to the start of each month.
|
|
1765
|
+
const $f3ed2e4472ae7e25$var$MONTH_START = [
|
|
1766
|
+
0,
|
|
1767
|
+
31,
|
|
1768
|
+
62,
|
|
1769
|
+
93,
|
|
1770
|
+
124,
|
|
1771
|
+
155,
|
|
1772
|
+
186,
|
|
1773
|
+
216,
|
|
1774
|
+
246,
|
|
1775
|
+
276,
|
|
1776
|
+
306,
|
|
1777
|
+
336 // Esfand
|
|
1778
|
+
];
|
|
1775
1779
|
class $f3ed2e4472ae7e25$export$37fccdbfd14c5939 {
|
|
1776
1780
|
fromJulianDay(jd) {
|
|
1777
|
-
let
|
|
1778
|
-
let
|
|
1779
|
-
let
|
|
1780
|
-
let
|
|
1781
|
-
let
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
let month = yDay <= 186 ? Math.ceil(yDay / 31) : Math.ceil((yDay - 6) / 31);
|
|
1785
|
-
let day = jd - $f3ed2e4472ae7e25$var$persianToJulianDay(year, month, 1) + 1;
|
|
1786
|
-
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, year, month, day);
|
|
1781
|
+
let daysSinceEpoch = jd - $f3ed2e4472ae7e25$var$PERSIAN_EPOCH;
|
|
1782
|
+
let year = 1 + Math.floor((33 * daysSinceEpoch + 3) / 12053);
|
|
1783
|
+
let farvardin1 = 365 * (year - 1) + Math.floor((8 * year + 21) / 33);
|
|
1784
|
+
let dayOfYear = daysSinceEpoch - farvardin1;
|
|
1785
|
+
let month = dayOfYear < 216 ? Math.floor(dayOfYear / 31) : Math.floor((dayOfYear - 6) / 30);
|
|
1786
|
+
let day = dayOfYear - $f3ed2e4472ae7e25$var$MONTH_START[month] + 1;
|
|
1787
|
+
return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(this, year, month + 1, day);
|
|
1787
1788
|
}
|
|
1788
1789
|
toJulianDay(date) {
|
|
1789
|
-
|
|
1790
|
+
let jd = $f3ed2e4472ae7e25$var$PERSIAN_EPOCH - 1 + 365 * (date.year - 1) + Math.floor((8 * date.year + 21) / 33);
|
|
1791
|
+
jd += $f3ed2e4472ae7e25$var$MONTH_START[date.month - 1];
|
|
1792
|
+
jd += date.day;
|
|
1793
|
+
return jd;
|
|
1790
1794
|
}
|
|
1791
1795
|
getMonthsInYear() {
|
|
1792
1796
|
return 12;
|
|
@@ -1794,7 +1798,8 @@ class $f3ed2e4472ae7e25$export$37fccdbfd14c5939 {
|
|
|
1794
1798
|
getDaysInMonth(date) {
|
|
1795
1799
|
if (date.month <= 6) return 31;
|
|
1796
1800
|
if (date.month <= 11) return 30;
|
|
1797
|
-
|
|
1801
|
+
let isLeapYear = (0, $2b4dce13dd5a17fa$export$842a2cf37af977e1)(25 * date.year + 11, 33) < 8;
|
|
1802
|
+
return isLeapYear ? 30 : 29;
|
|
1798
1803
|
}
|
|
1799
1804
|
getEras() {
|
|
1800
1805
|
return [
|
package/dist/main.js
CHANGED
|
@@ -1825,33 +1825,37 @@ function $9cc5d3577ec40243$var$toGregorian(date) {
|
|
|
1825
1825
|
// Original licensing can be found in the NOTICE file in the root directory of this source tree.
|
|
1826
1826
|
|
|
1827
1827
|
|
|
1828
|
-
const $3c060181fc7249ae$var$PERSIAN_EPOCH =
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1828
|
+
const $3c060181fc7249ae$var$PERSIAN_EPOCH = 1948320;
|
|
1829
|
+
// Number of days from the start of the year to the start of each month.
|
|
1830
|
+
const $3c060181fc7249ae$var$MONTH_START = [
|
|
1831
|
+
0,
|
|
1832
|
+
31,
|
|
1833
|
+
62,
|
|
1834
|
+
93,
|
|
1835
|
+
124,
|
|
1836
|
+
155,
|
|
1837
|
+
186,
|
|
1838
|
+
216,
|
|
1839
|
+
246,
|
|
1840
|
+
276,
|
|
1841
|
+
306,
|
|
1842
|
+
336 // Esfand
|
|
1843
|
+
];
|
|
1840
1844
|
class $3c060181fc7249ae$export$37fccdbfd14c5939 {
|
|
1841
1845
|
fromJulianDay(jd) {
|
|
1842
|
-
let
|
|
1843
|
-
let
|
|
1844
|
-
let
|
|
1845
|
-
let
|
|
1846
|
-
let
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
let month = yDay <= 186 ? Math.ceil(yDay / 31) : Math.ceil((yDay - 6) / 31);
|
|
1850
|
-
let day = jd - $3c060181fc7249ae$var$persianToJulianDay(year, month, 1) + 1;
|
|
1851
|
-
return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(this, year, month, day);
|
|
1846
|
+
let daysSinceEpoch = jd - $3c060181fc7249ae$var$PERSIAN_EPOCH;
|
|
1847
|
+
let year = 1 + Math.floor((33 * daysSinceEpoch + 3) / 12053);
|
|
1848
|
+
let farvardin1 = 365 * (year - 1) + Math.floor((8 * year + 21) / 33);
|
|
1849
|
+
let dayOfYear = daysSinceEpoch - farvardin1;
|
|
1850
|
+
let month = dayOfYear < 216 ? Math.floor(dayOfYear / 31) : Math.floor((dayOfYear - 6) / 30);
|
|
1851
|
+
let day = dayOfYear - $3c060181fc7249ae$var$MONTH_START[month] + 1;
|
|
1852
|
+
return new (0, $625ad1e1f4c43bc1$export$99faa760c7908e4f)(this, year, month + 1, day);
|
|
1852
1853
|
}
|
|
1853
1854
|
toJulianDay(date) {
|
|
1854
|
-
|
|
1855
|
+
let jd = $3c060181fc7249ae$var$PERSIAN_EPOCH - 1 + 365 * (date.year - 1) + Math.floor((8 * date.year + 21) / 33);
|
|
1856
|
+
jd += $3c060181fc7249ae$var$MONTH_START[date.month - 1];
|
|
1857
|
+
jd += date.day;
|
|
1858
|
+
return jd;
|
|
1855
1859
|
}
|
|
1856
1860
|
getMonthsInYear() {
|
|
1857
1861
|
return 12;
|
|
@@ -1859,7 +1863,8 @@ class $3c060181fc7249ae$export$37fccdbfd14c5939 {
|
|
|
1859
1863
|
getDaysInMonth(date) {
|
|
1860
1864
|
if (date.month <= 6) return 31;
|
|
1861
1865
|
if (date.month <= 11) return 30;
|
|
1862
|
-
|
|
1866
|
+
let isLeapYear = (0, $a5090d6430502238$export$842a2cf37af977e1)(25 * date.year + 11, 33) < 8;
|
|
1867
|
+
return isLeapYear ? 30 : 29;
|
|
1863
1868
|
}
|
|
1864
1869
|
getEras() {
|
|
1865
1870
|
return [
|