jewish-date 2.0.4 → 2.0.6

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.
@@ -1,2 +1,2 @@
1
1
  export*from"./interfaces";export*from"./jewishDate";export*from"./jewishDateHebrew";
2
- //# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
1
  const e={None:"None",Tishri:"Tishri",Cheshvan:"Cheshvan",Kislev:"Kislev",Tevet:"Tevet",Shevat:"Shevat",Adar:"Adar",Nisan:"Nisan",Iyyar:"Iyyar",Sivan:"Sivan",Tammuz:"Tammuz",Av:"Av",Elul:"Elul",AdarI:"AdarI",AdarII:"AdarII"};export{e as JewishMonth};
2
- //# sourceMappingURL=interfaces.js.map
2
+ //# sourceMappingURL=interfaces.mjs.map
@@ -1,2 +1,2 @@
1
1
  import{JewishMonth as e}from"./interfaces";import{gregorianToJd as y,hebrewMonthDays as I,hebrewToJd as J,jdToGregorian as M,jdToHebrew as p}from"./utils/dateUtils";import{toLength as i}from"./utils/numberUtils";const m=t=>{const n=t%19;return n===0||n===3||n===6||n===8||n===11||n===14||n===17},w=t=>({[e.None]:0,[e.Tishri]:7,[e.Cheshvan]:8,[e.Kislev]:9,[e.Tevet]:10,[e.Shevat]:11,[e.Adar]:12,[e.AdarI]:12,[e.AdarII]:13,[e.Nisan]:1,[e.Iyyar]:2,[e.Sivan]:3,[e.Tammuz]:4,[e.Av]:5,[e.Elul]:6})[t]||0,T=(t,n)=>{const o=[e.None,e.Nisan,e.Iyyar,e.Sivan,e.Tammuz,e.Av,e.Elul,e.Tishri,e.Cheshvan,e.Kislev,e.Tevet,e.Shevat,e.Adar,e.AdarII][t]||e.None;return o===e.Adar&&m(n)?e.AdarI:o},v=t=>{const n=[e.None,e.Tishri,e.Cheshvan,e.Kislev,e.Tevet,e.Shevat,e.AdarI,e.AdarII,e.Nisan,e.Iyyar,e.Sivan,e.Tammuz,e.Av,e.Elul];return m(t)?n:n.filter(r=>r!=="AdarII").map(r=>r==="AdarI"?"Adar":r)},j=t=>`${t.day} ${t.monthName} ${t.year}`,f=t=>{const n=t.getFullYear(),r=t.getMonth()+1,o=t.getDate(),a=y(n,r,o),s=p(a),h=s[0],c=T(s[1],h),d=v(h).findIndex(u=>u===c);return{year:h,monthName:c,month:d,day:s[2]}},S=t=>{const n=w(t.monthName),r=J(t.year,n,t.day),o=M(r),a=`${i(o[0],4)}-${i(o[1],2)}-${i(o[2],2)}`,s=new Date(a);return s.getHours()>0&&s.setHours(0,0,0,0),s},$=(t,n)=>{const r=w(n);return I(t,r)};export{$ as calcDaysInMonth,j as formatJewishDate,w as getIndexByJewishMonth,T as getJewishMonthByIndex,v as getJewishMonthsInOrder,m as isLeapYear,S as toGregorianDate,f as toJewishDate};
2
- //# sourceMappingURL=jewishDate.js.map
2
+ //# sourceMappingURL=jewishDate.mjs.map
@@ -1,2 +1,2 @@
1
1
  import n from"gematriya";import{JewishMonth as e}from"./interfaces";const i=t=>({[e.None]:"\u05DC\u05DC\u05D0",[e.Tishri]:"\u05EA\u05E9\u05E8\u05D9",[e.Cheshvan]:"\u05D7\u05E9\u05D5\u05DF",[e.Kislev]:"\u05DB\u05E1\u05DC\u05D5",[e.Tevet]:"\u05D8\u05D1\u05EA",[e.Shevat]:"\u05E9\u05D1\u05D8",[e.Adar]:"\u05D0\u05D3\u05E8",[e.AdarI]:"\u05D0\u05D3\u05E8 \u05D0",[e.AdarII]:"\u05D0\u05D3\u05E8 \u05D1",[e.Nisan]:"\u05E0\u05D9\u05E1\u05DF",[e.Iyyar]:"\u05D0\u05D9\u05D9\u05E8",[e.Sivan]:"\u05E1\u05D9\u05D5\u05DF",[e.Tammuz]:"\u05EA\u05DE\u05D5\u05D6",[e.Av]:"\u05D0\u05D1",[e.Elul]:"\u05D0\u05DC\u05D5\u05DC"})[t],a=(t,r=!0,s=!0)=>n(t,{geresh:r,punctuate:s}),o=t=>({day:a(t.day),monthName:i(t.monthName),year:a(t.year)}),b=t=>{const r=o(t);return`${r.day} ${r.monthName} ${r.year}`};export{a as convertNumberToHebrew,b as formatJewishDateInHebrew,i as getJewishMonthInHebrew,o as toHebrewJewishDate};
2
- //# sourceMappingURL=jewishDateHebrew.js.map
2
+ //# sourceMappingURL=jewishDateHebrew.mjs.map
@@ -1,2 +1,2 @@
1
1
  const p=17214255e-1,R=347995.5;function c(n,r){return n-r*Math.floor(n/r)}function E(n){return n%4===0&&!(n%100===0&&n%400!==0)}function d(n,r,t){return p-1+365*(n-1)+Math.floor((n-1)/4)+-Math.floor((n-1)/100)+Math.floor((n-1)/400)+Math.floor((367*r-362)/12+(r<=2?0:E(n)?-1:-2)+t)}function C(n){const r=Math.floor(n-.5)+.5,t=r-p,e=Math.floor(t/146097),o=c(t,146097),u=Math.floor(o/36524),s=c(o,36524),i=Math.floor(s/1461),b=c(s,1461),h=Math.floor(b/365);let f=e*400+u*100+i*4+h;u===4||h===4||f++;const x=r-d(f,1,1),j=r<d(f,3,1)?0:E(f)?1:2,M=Math.floor(((x+j)*12+373)/367),O=r-d(f,M,1)+1;return[f,M,O]}function H(n){return c(n*7+1,19)<7}function g(n){return H(n)?13:12}function l(n){const r=Math.floor((235*n-234)/19),t=12084+13753*r;let e=r*29+Math.floor(t/25920);return c(3*(e+1),7)<3&&e++,e}function q(n){const r=l(n-1),t=l(n);return l(n+1)-t===356?2:t-r===382?1:0}function w(n){return m(n+1,7,1)-m(n,7,1)}function a(n,r){return r===2||r===4||r===6||r===10||r===13||r===12&&!H(n)||r===8&&c(w(n),10)!==5||r===9&&c(w(n),10)===3?29:30}function m(n,r,t){let e;const o=g(n);let u=R+l(n)+q(n)+t+1;if(r<7){for(e=7;e<=o;e++)u+=a(n,e);for(e=1;e<r;e++)u+=a(n,e)}else for(e=7;e<r;e++)u+=a(n,e);return u}function D(n){let t,e;const o=Math.floor(n)+.5,u=Math.floor((o-347995.5)*98496/35975351);t=u-1;for(let b=u;o>=m(b,7,1);b++)t++;const s=o<m(t,1,1)?7:1;e=s;for(let b=s;o>m(t,b,a(t,b));b++)e++;const i=o-m(t,e,1)+1;return[t,e,i]}export{d as gregorianToJd,a as hebrewMonthDays,m as hebrewToJd,C as jdToGregorian,D as jdToHebrew,c as mod};
2
- //# sourceMappingURL=dateConverterUtils.js.map
2
+ //# sourceMappingURL=dateConverterUtils.mjs.map
@@ -1,2 +1,2 @@
1
1
  export*from"./dateConverterUtils";
2
- //# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,2 @@
1
+ export*from"./numberUtils";
2
+ //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
1
  const n=(t,r)=>t.toString().padStart(r,"0");export{n as toLength};
2
- //# sourceMappingURL=numberUtils.js.map
2
+ //# sourceMappingURL=numberUtils.mjs.map
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "jewish-date",
3
3
  "description": "Converts Gregorian dates to Hebrew dates and vice versa.",
4
- "version": "2.0.4",
4
+ "version": "2.0.6",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
- "module": "dist/mjs/index.js",
7
+ "module": "dist/mjs/index.mjs",
8
8
  "types": "lib/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "import": "./dist/mjs/index.js",
11
+ "import": "./dist/mjs/index.mjs",
12
12
  "require": "./dist/index.js"
13
13
  }
14
14
  },
@@ -1,2 +0,0 @@
1
- export*from"./numberUtils";
2
- //# sourceMappingURL=index.js.map
File without changes