@hebcal/core 3.28.0 → 3.29.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.
- package/README.md +1 -1
- package/dist/bundle.js +101 -1043
- package/dist/bundle.min.js +2 -2
- package/dist/hdate-bundle.js +929 -1840
- package/dist/hdate-bundle.min.js +2 -2
- package/dist/hdate.js +33 -16
- package/dist/hdate.mjs +33 -16
- package/dist/index.js +61 -26
- package/dist/index.mjs +61 -26
- package/package.json +4 -4
package/dist/hdate-bundle.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @hebcal/core v3.
|
|
2
|
-
var hebcal=function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=function(t){return t&&t.Math==Math&&t},n=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||function(){return this}()||Function("return this")(),a={},o=function(t){try{return!!t()}catch(t){return!0}},i=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),s=Function.prototype.call,u=s.bind?s.bind(s):function(){return s.apply(s,arguments)},c={},h={}.propertyIsEnumerable,f=Object.getOwnPropertyDescriptor,l=f&&!h.call({1:2},1);c.f=l?function(t){var e=f(this,t);return!!e&&e.enumerable}:h;var y,d,p=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},g=Function.prototype,m=g.bind,b=g.call,v=m&&m.bind(b),w=m?function(t){return t&&v(b,t)}:function(t){return t&&function(){return b.apply(t,arguments)}},M=w,S=M({}.toString),I=M("".slice),O=function(t){return I(S(t),8,-1)},D=w,L=o,E=O,T=n.Object,Y=D("".split),N=L((function(){return!T("z").propertyIsEnumerable(0)}))?function(t){return"String"==E(t)?Y(t,""):T(t)}:T,j=n.TypeError,A=function(t){if(null==t)throw j("Can't call method on "+t);return t},F=N,x=A,k=function(t){return F(x(t))},C=function(t){return"function"==typeof t},P=C,_=function(t){return"object"==typeof t?null!==t:P(t)},z=n,H=C,R=function(t){return H(t)?t:void 0},U=function(t,e){return arguments.length<2?R(z[t]):z[t]&&z[t][e]},V=w({}.isPrototypeOf),B=n,K=U("navigator","userAgent")||"",G=B.process,$=B.Deno,J=G&&G.versions||$&&$.version,q=J&&J.v8;q&&(d=(y=q.split("."))[0]>0&&y[0]<4?1:+(y[0]+y[1])),!d&&K&&(!(y=K.match(/Edge\/(\d+)/))||y[1]>=74)&&(y=K.match(/Chrome\/(\d+)/))&&(d=+y[1]);var W=d,X=o,Z=!!Object.getOwnPropertySymbols&&!X((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&W&&W<41})),Q=Z&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,tt=U,et=C,rt=V,nt=Q,at=n.Object,ot=nt?function(t){return"symbol"==typeof t}:function(t){var e=tt("Symbol");return et(e)&&rt(e.prototype,at(t))},it=n.String,st=C,ut=function(t){try{return it(t)}catch(t){return"Object"}},ct=n.TypeError,ht=function(t){if(st(t))return t;throw ct(ut(t)+" is not a function")},ft=u,lt=C,yt=_,dt=n.TypeError,pt={exports:{}},gt=n,mt=Object.defineProperty,bt=function(t,e){try{mt(gt,t,{value:e,configurable:!0,writable:!0})}catch(r){gt[t]=e}return e},vt=bt,wt="__core-js_shared__",Mt=n[wt]||vt(wt,{}),St=Mt;(pt.exports=function(t,e){return St[t]||(St[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.19.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var It=A,Ot=n.Object,Dt=function(t){return Ot(It(t))},Lt=w({}.hasOwnProperty),Et=Object.hasOwn||function(t,e){return Lt(Dt(t),e)},Tt=w,Yt=0,Nt=Math.random(),jt=Tt(1..toString),At=function(t){return"Symbol("+(void 0===t?"":t)+")_"+jt(++Yt+Nt,36)},Ft=n,xt=pt.exports,kt=Et,Ct=At,Pt=Z,_t=Q,zt=xt("wks"),Ht=Ft.Symbol,Rt=Ht&&Ht.for,Ut=_t?Ht:Ht&&Ht.withoutSetter||Ct,Vt=function(t){if(!kt(zt,t)||!Pt&&"string"!=typeof zt[t]){var e="Symbol."+t;Pt&&kt(Ht,t)?zt[t]=Ht[t]:zt[t]=_t&&Rt?Rt(e):Ut(e)}return zt[t]},Bt=u,Kt=_,Gt=ot,$t=function(t,e){var r=t[e];return null==r?void 0:ht(r)},Jt=function(t,e){var r,n;if("string"===e&<(r=t.toString)&&!yt(n=ft(r,t)))return n;if(lt(r=t.valueOf)&&!yt(n=ft(r,t)))return n;if("string"!==e&<(r=t.toString)&&!yt(n=ft(r,t)))return n;throw dt("Can't convert object to primitive value")},qt=Vt,Wt=n.TypeError,Xt=qt("toPrimitive"),Zt=function(t,e){if(!Kt(t)||Gt(t))return t;var r,n=$t(t,Xt);if(n){if(void 0===e&&(e="default"),r=Bt(n,t,e),!Kt(r)||Gt(r))return r;throw Wt("Can't convert object to primitive value")}return void 0===e&&(e="number"),Jt(t,e)},Qt=ot,te=function(t){var e=Zt(t,"string");return Qt(e)?e:e+""},ee=_,re=n.document,ne=ee(re)&&ee(re.createElement),ae=function(t){return ne?re.createElement(t):{}},oe=!i&&!o((function(){return 7!=Object.defineProperty(ae("div"),"a",{get:function(){return 7}}).a})),ie=i,se=u,ue=c,ce=p,he=k,fe=te,le=Et,ye=oe,de=Object.getOwnPropertyDescriptor;a.f=ie?de:function(t,e){if(t=he(t),e=fe(e),ye)try{return de(t,e)}catch(t){}if(le(t,e))return ce(!se(ue.f,t,e),t[e])};var pe={},ge=n,me=_,be=ge.String,ve=ge.TypeError,we=function(t){if(me(t))return t;throw ve(be(t)+" is not an object")},Me=i,Se=oe,Ie=we,Oe=te,De=n.TypeError,Le=Object.defineProperty;pe.f=Me?Le:function(t,e,r){if(Ie(t),e=Oe(e),Ie(r),Se)try{return Le(t,e,r)}catch(t){}if("get"in r||"set"in r)throw De("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var Ee=pe,Te=p,Ye=i?function(t,e,r){return Ee.f(t,e,Te(1,r))}:function(t,e,r){return t[e]=r,t},Ne={exports:{}},je=C,Ae=Mt,Fe=w(Function.toString);je(Ae.inspectSource)||(Ae.inspectSource=function(t){return Fe(t)});var xe,ke,Ce,Pe=Ae.inspectSource,_e=C,ze=Pe,He=n.WeakMap,Re=_e(He)&&/native code/.test(ze(He)),Ue=pt.exports,Ve=At,Be=Ue("keys"),Ke={},Ge=Re,$e=n,Je=w,qe=_,We=Ye,Xe=Et,Ze=Mt,Qe=function(t){return Be[t]||(Be[t]=Ve(t))},tr=Ke,er="Object already initialized",rr=$e.TypeError,nr=$e.WeakMap;if(Ge||Ze.state){var ar=Ze.state||(Ze.state=new nr),or=Je(ar.get),ir=Je(ar.has),sr=Je(ar.set);xe=function(t,e){if(ir(ar,t))throw new rr(er);return e.facade=t,sr(ar,t,e),e},ke=function(t){return or(ar,t)||{}},Ce=function(t){return ir(ar,t)}}else{var ur=Qe("state");tr[ur]=!0,xe=function(t,e){if(Xe(t,ur))throw new rr(er);return e.facade=t,We(t,ur,e),e},ke=function(t){return Xe(t,ur)?t[ur]:{}},Ce=function(t){return Xe(t,ur)}}var cr={set:xe,get:ke,has:Ce,enforce:function(t){return Ce(t)?ke(t):xe(t,{})},getterFor:function(t){return function(e){var r;if(!qe(e)||(r=ke(e)).type!==t)throw rr("Incompatible receiver, "+t+" required");return r}}},hr=i,fr=Et,lr=Function.prototype,yr=hr&&Object.getOwnPropertyDescriptor,dr=fr(lr,"name"),pr=dr&&"something"===function(){}.name,gr=dr&&(!hr||hr&&yr(lr,"name").configurable),mr=n,br=C,vr=Et,wr=Ye,Mr=bt,Sr=Pe,Ir={EXISTS:dr,PROPER:pr,CONFIGURABLE:gr}.CONFIGURABLE,Or=cr.get,Dr=cr.enforce,Lr=String(String).split("String");(Ne.exports=function(t,e,r,n){var a,o=!!n&&!!n.unsafe,i=!!n&&!!n.enumerable,s=!!n&&!!n.noTargetGet,u=n&&void 0!==n.name?n.name:e;br(r)&&("Symbol("===String(u).slice(0,7)&&(u="["+String(u).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!vr(r,"name")||Ir&&r.name!==u)&&wr(r,"name",u),(a=Dr(r)).source||(a.source=Lr.join("string"==typeof u?u:""))),t!==mr?(o?!s&&t[e]&&(i=!0):delete t[e],i?t[e]=r:wr(t,e,r)):i?t[e]=r:Mr(e,r)})(Function.prototype,"toString",(function(){return br(this)&&Or(this).source||Sr(this)}));var Er={},Tr=Math.ceil,Yr=Math.floor,Nr=function(t){var e=+t;return e!=e||0===e?0:(e>0?Yr:Tr)(e)},jr=Nr,Ar=Math.max,Fr=Math.min,xr=Nr,kr=Math.min,Cr=function(t){return t>0?kr(xr(t),9007199254740991):0},Pr=k,_r=function(t,e){var r=jr(t);return r<0?Ar(r+e,0):Fr(r,e)},zr=function(t){return Cr(t.length)},Hr=function(t){return function(e,r,n){var a,o=Pr(e),i=zr(o),s=_r(n,i);if(t&&r!=r){for(;i>s;)if((a=o[s++])!=a)return!0}else for(;i>s;s++)if((t||s in o)&&o[s]===r)return t||s||0;return!t&&-1}},Rr={includes:Hr(!0),indexOf:Hr(!1)},Ur=Et,Vr=k,Br=Rr.indexOf,Kr=Ke,Gr=w([].push),$r=function(t,e){var r,n=Vr(t),a=0,o=[];for(r in n)!Ur(Kr,r)&&Ur(n,r)&&Gr(o,r);for(;e.length>a;)Ur(n,r=e[a++])&&(~Br(o,r)||Gr(o,r));return o},Jr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");Er.f=Object.getOwnPropertyNames||function(t){return $r(t,Jr)};var qr={};qr.f=Object.getOwnPropertySymbols;var Wr=U,Xr=Er,Zr=qr,Qr=we,tn=w([].concat),en=Wr("Reflect","ownKeys")||function(t){var e=Xr.f(Qr(t)),r=Zr.f;return r?tn(e,r(t)):e},rn=Et,nn=en,an=a,on=pe,sn=o,un=C,cn=/#|\.prototype\./,hn=function(t,e){var r=ln[fn(t)];return r==dn||r!=yn&&(un(e)?sn(e):!!e)},fn=hn.normalize=function(t){return String(t).replace(cn,".").toLowerCase()},ln=hn.data={},yn=hn.NATIVE="N",dn=hn.POLYFILL="P",pn=hn,gn=n,mn=a.f,bn=Ye,vn=Ne.exports,wn=bt,Mn=function(t,e){for(var r=nn(e),n=on.f,a=an.f,o=0;o<r.length;o++){var i=r[o];rn(t,i)||n(t,i,a(e,i))}},Sn=pn,In={};In[Vt("toStringTag")]="z";var On=n,Dn="[object z]"===String(In),Ln=C,En=O,Tn=Vt("toStringTag"),Yn=On.Object,Nn="Arguments"==En(function(){return arguments}()),jn=Dn?En:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Yn(t),Tn))?r:Nn?En(e):"Object"==(n=En(e))&&Ln(e.callee)?"Arguments":n},An=n.String,Fn=function(t){if("Symbol"===jn(t))throw TypeError("Cannot convert a Symbol value to a string");return An(t)},xn="\t\n\v\f\r \u2028\u2029\ufeff",kn=A,Cn=Fn,Pn=w("".replace),_n="[\t\n\v\f\r \u2028\u2029\ufeff]",zn=RegExp("^"+_n+_n+"*"),Hn=RegExp(_n+_n+"*$"),Rn=function(t){return function(e){var r=Cn(kn(e));return 1&t&&(r=Pn(r,zn,"")),2&t&&(r=Pn(r,Hn,"")),r}},Un={start:Rn(1),end:Rn(2),trim:Rn(3)},Vn=n,Bn=o,Kn=w,Gn=Fn,$n=Un.trim,Jn=xn,qn=Vn.parseInt,Wn=Vn.Symbol,Xn=Wn&&Wn.iterator,Zn=/^[+-]?0x/i,Qn=Kn(Zn.exec),ta=8!==qn(Jn+"08")||22!==qn(Jn+"0x16")||Xn&&!Bn((function(){qn(Object(Xn))}))?function(t,e){var r=$n(Gn(t));return qn(r,e>>>0||(Qn(Zn,r)?16:10))}:qn;(function(t,e){var r,n,a,o,i,s=t.target,u=t.global,c=t.stat;if(r=u?gn:c?gn[s]||wn(s,{}):(gn[s]||{}).prototype)for(n in e){if(o=e[n],a=t.noTargetGet?(i=mn(r,n))&&i.value:r[n],!Sn(u?n:s+(c?".":"#")+n,t.forced)&&void 0!==a){if(typeof o==typeof a)continue;Mn(o,a)}(t.sham||a&&a.sham)&&bn(o,"sham",!0),vn(r,n,o,t)}})({global:!0,forced:parseInt!=ta},{parseInt:ta});function ea(t){switch(t){case 1:return"א";case 2:return"ב";case 3:return"ג";case 4:return"ד";case 5:return"ה";case 6:return"ו";case 7:return"ז";case 8:return"ח";case 9:return"ט";case 10:return"י";case 20:return"כ";case 30:return"ל";case 40:return"מ";case 50:return"נ";case 60:return"ס";case 70:return"ע";case 80:return"פ";case 90:return"צ";case 100:return"ק";case 200:return"ר";case 300:return"ש";case 400:return"ת";default:return"*INVALID*"}}function ra(t){let e=parseInt(t,10);if(!e)throw new TypeError("invalid parameter to gematriya ".concat(t));const r=[];for(e%=1e3;e>0;){if(15===e||16===e){r.push(9),r.push(e-9);break}let t,n=100;for(t=400;t>e;t-=n)t===n&&(n/=10);r.push(t),e-=t}if(1==r.length)return ea(r[0])+"׳";let n="";for(let t=0;t<r.length;t++)t+1===r.length&&(n+="״"),n+=ea(r[t]);return n}const na=[[0,31,28,31,30,31,30,31,31,30,31,30,31],[0,31,29,31,30,31,30,31,31,30,31,30,31]];function aa(t,e){return t-e*Math.floor(t/e)}function oa(t,e){return Math.floor(t/e)}const ia={monthNames:["","January","February","March","April","May","June","July","August","September","October","November","December"],isLeapYear:function(t){return!(t%4||!(t%100)&&t%400)},daysInMonth:function(t,e){return na[+this.isLeapYear(e)][t]},isDate:function(t){return"object"==typeof t&&Date.prototype===t.__proto__},dayOfYear:function(t){if(!this.isDate(t))throw new TypeError("Argument to greg.dayOfYear not a Date");let e=t.getDate()+31*t.getMonth();return t.getMonth()>1&&(e-=Math.floor((4*(t.getMonth()+1)+23)/10),this.isLeapYear(t.getFullYear())&&e++),e},greg2abs:function(t){if(!this.isDate(t))throw new TypeError("Argument to greg.greg2abs not a Date");const e=t.getFullYear()-1;return this.dayOfYear(t)+365*e+(Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))},yearFromFixed:function(t){const e=t-1,r=oa(e,146097),n=aa(e,146097),a=oa(n,36524),o=aa(n,36524),i=oa(o,1461),s=oa(aa(o,1461),365),u=400*r+100*a+4*i+s;return 4!=a&&4!=s?u+1:u},toFixed:function(t,e,r){const n=t-1;return 0+365*n+oa(n,4)-oa(n,100)+oa(n,400)+oa(367*e-362,12)+Math.floor(e<=2?0:this.isLeapYear(t)?-1:-2)+r},abs2greg:function(t){if("number"!=typeof t)throw new TypeError("Argument to greg.abs2greg not a Number");t=Math.trunc(t);const e=this.yearFromFixed(t),r=oa(12*(t-this.toFixed(e,1,1)+(t<this.toFixed(e,3,1)?0:this.isLeapYear(e)?1:2))+373,367),n=t-this.toFixed(e,r,1)+1,a=new Date(e,r-1,n);return e<100&&e>=0&&a.setFullYear(e),a}},sa={headers:{"plural-forms":"nplurals=2; plural=(n!=1);"},contexts:{"":{}}},ua={h:"he",a:"ashkenazi",s:"en","":"en"},ca={locales:Object.create(null),activeLocale:null,activeName:null,lookupTranslation:function(t,e){const r=e&&e.toLowerCase(),n=("string"==typeof e&&this.locales[r]||this.activeLocale)[t];if(n&&n.length&&n[0].length)return n[0]},gettext:function(t,e){const r=this.lookupTranslation(t,e);return void 0===r?t:r},addLocale:function(t,e){if("object"!=typeof e.contexts||"object"!=typeof e.contexts[""])throw new TypeError("Locale '".concat(t,"' invalid compact format"));this.locales[t.toLowerCase()]=e.contexts[""]},useLocale:function(t){const e=t.toLowerCase(),r=this.locales[e];if(!r)throw new RangeError("Locale '".concat(t,"' not found"));return this.activeName=ua[e]||e,this.activeLocale=r,this.activeLocale},getLocaleName:function(){return this.activeName},ordinal:function(t,e){const r=e&&e.toLowerCase()||this.activeName;if(!r)return this.getEnOrdinal(t);switch(r){case"en":case"s":case"a":case"ashkenazi":case"ashkenazi_litvish":case"ashkenazi_poylish":case"ashkenazi_standard":return this.getEnOrdinal(t);case"es":return t+"º";case"h":case"he":case"he-x-nonikud":return String(t);default:return t+"."}},getEnOrdinal:function(t){const e=["th","st","nd","rd"],r=t%100;return t+(e[(r-20)%10]||e[r]||e[0])},hebrewStripNikkud:function(t){return t.replace(/[\u0590-\u05bd]/g,"").replace(/[\u05bf-\u05c7]/g,"")}};ca.addLocale("en",sa),ca.addLocale("s",sa),ca.addLocale("",sa),ca.useLocale("en");const ha=["","Nisan","Iyyar","Sivan","Tamuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Sh'vat"],fa=[ha.concat(["Adar","Nisan"]),ha.concat(["Adar I","Adar II","Nisan"])];function la(t){throw new TypeError(t)}const ya=Object.create(null),da=-1373428,pa="day",ga="week",ma="month",ba="year",va={d:pa,w:ga,M:ma,y:ba},wa={day:pa,week:ga,month:ma,year:ba};class Ma{constructor(t,e,r){if(2==arguments.length||arguments.length>3)throw new TypeError("HDate constructor requires 0, 1 or 3 arguments");if(3==arguments.length){if(this.day=this.month=1,this.year=+r,isNaN(this.year))throw new TypeError("HDate called with bad year argument: ".concat(r));if(this.setMonth(e),this.setDate(+t),isNaN(this.day))throw new TypeError("HDate called with bad day argument: ".concat(t))}else{void 0===t&&(t=new Date);const e="number"!=typeof t||isNaN(t)?ia.isDate(t)?ia.greg2abs(t):Ma.isHDate(t)?{dd:t.day,mm:t.month,yy:t.year}:la("HDate called with bad argument: ".concat(t)):t,r="number"==typeof e,n=r?Ma.abs2hebrew(e):e;this.day=n.dd,this.month=n.mm,this.year=n.yy,r&&(this.abs0=e)}}getFullYear(){return this.year}isLeapYear(){return Ma.isLeapYear(this.year)}getMonth(){return this.month}getTishreiMonth(){const t=Ma.monthsInYear(this.getFullYear());return(this.getMonth()+t-6)%t||t}daysInMonth(){return Ma.daysInMonth(this.getMonth(),this.getFullYear())}getDate(){return this.day}getDay(){return aa(this.abs(),7)}setFullYear(t){return this.year=t,Sa(this),this}setMonth(t){return this.month=Ma.monthNum(t),Sa(this),this}setDate(t){return this.day=t,Sa(this),this}greg(){return ia.abs2greg(this.abs())}abs(){return"number"!=typeof this.abs0&&(this.abs0=Ma.hebrew2abs(this.year,this.month,this.day)),this.abs0}static hebrew2abs(t,e,r){let n=r;if(e<7){for(let e=7;e<=Ma.monthsInYear(t);e++)n+=Ma.daysInMonth(e,t);for(let r=1;r<e;r++)n+=Ma.daysInMonth(r,t)}else for(let r=7;r<e;r++)n+=Ma.daysInMonth(r,t);return da+Ma.elapsedDays(t)+n-1}static newYear(t){return da+Ma.elapsedDays(t)+Ma.newYearDelay(t)}static newYearDelay(t){const e=Ma.elapsedDays(t);if(Ma.elapsedDays(t+1)-e==356)return 2;return e-Ma.elapsedDays(t-1)==382?1:0}static abs2hebrew(t){if("number"!=typeof t||isNaN(t))throw new TypeError("invalid parameter to abs2hebrew ".concat(t));t=Math.trunc(t);let e=Math.floor((t-da)/365.24682220597794);for(;Ma.newYear(e)<=t;)++e;--e;let r=t<Ma.hebrew2abs(e,1,1)?7:1;for(;t>Ma.hebrew2abs(e,r,Ma.daysInMonth(r,e));)++r;return{yy:e,mm:r,dd:1+t-Ma.hebrew2abs(e,r,1)}}getMonthName(){return Ma.getMonthName(this.getMonth(),this.getFullYear())}render(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=t||ca.getLocaleName(),n=this.getDate(),a=ca.gettext(this.getMonthName(),t),o=ca.ordinal(n,r);let i="";if("en"===r||"s"===r||"ashkenazi"==r.substring(0,9))i=" of";else{const t=ca.lookupTranslation("of",r);t&&(i=" "+t)}const s="".concat(o).concat(i," ").concat(a);if(e){const t=this.getFullYear();return"".concat(s,", ").concat(t)}return s}renderGematriya(){const t=this.getDate(),e=ca.gettext(this.getMonthName(),"he"),r=this.getFullYear();return ra(t)+" "+e+" "+ra(r)}before(t){return Oa(t,this,-1)}onOrBefore(t){return Oa(t,this,0)}nearest(t){return Oa(t,this,3)}onOrAfter(t){return Oa(t,this,6)}after(t){return Oa(t,this,7)}next(){return new Ma(this.abs()+1)}prev(){return new Ma(this.abs()-1)}add(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"d";if(!(t=parseInt(t,10)))return new Ma(this);if(e=Ma.standardizeUnits(e),e===pa)return new Ma(this.abs()+t);if(e===ga)return new Ma(this.abs()+7*t);if(e===ba)return new Ma(this.getDate(),this.getMonth(),this.getFullYear()+t);if(e===ma){let e=new Ma(this);const r=t>0?1:-1;t=Math.abs(t);for(let n=0;n<t;n++)e=new Ma(e.abs()+r*e.daysInMonth());return e}}static standardizeUnits(t){const e=va[t]||String(t||"").toLowerCase().replace(/s$/,"");return wa[e]||la("Invalid units '".concat(t,"'"))}subtract(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"d";return this.add(-1*t,e)}deltaDays(t){if(!Ma.isHDate(t))throw new TypeError("Bad argument: ".concat(t));return this.abs()-t.abs()}isSameDate(t){return!!Ma.isHDate(t)&&(this.year==t.year&&this.month==t.month&&this.day==t.day)}toString(){const t=this.getDate(),e=this.getFullYear(),r=this.getMonthName();return"".concat(t," ").concat(r," ").concat(e)}static isLeapYear(t){return(1+7*t)%19<7}static monthsInYear(t){return 12+Ma.isLeapYear(t)}static daysInMonth(t,e){return 2==t||4==t||6==t||10==t||13==t||12==t&&!Ma.isLeapYear(e)||8==t&&!Ma.longCheshvan(e)||9==t&&Ma.shortKislev(e)?29:30}static getMonthName(t,e){if("number"!=typeof t||t<1||t>14)throw new TypeError("bad month argument ".concat(t));return fa[+Ma.isLeapYear(e)][t]}static monthNum(t){return"number"==typeof t?t:t.charCodeAt(0)>=48&&t.charCodeAt(0)<=57?parseInt(t,10):Ma.monthFromName(t)}static elapsedDays(t){return ya[t]=ya[t]||Ma.elapsedDays0(t)}static elapsedDays0(t){const e=t-1,r=235*Math.floor(e/19)+e%19*12+Math.floor((e%19*7+1)/19),n=204+r%1080*793,a=5+12*r+793*Math.floor(r/1080)+Math.floor(n/1080),o=n%1080+a%24*1080,i=1+29*r+Math.floor(a/24),s=i+(o>=19440||2==i%7&&o>=9924&&!Ma.isLeapYear(t)||1==i%7&&o>=16789&&Ma.isLeapYear(e));return s+(s%7==0||s%7==3||s%7==5)}static daysInYear(t){return Ma.elapsedDays(t+1)-Ma.elapsedDays(t)}static longCheshvan(t){return Ma.daysInYear(t)%10==5}static shortKislev(t){return Ma.daysInYear(t)%10==3}static monthFromName(t){if("number"==typeof t)return t;const e=t.toLowerCase();switch(e[0]){case"n":case"נ":if("o"==e[1])break;return 1;case"i":return 2;case"e":return 6;case"c":case"ח":return 8;case"k":case"כ":return 9;case"s":switch(e[1]){case"i":return 3;case"h":return 11}case"t":switch(e[1]){case"a":return 4;case"i":return 7;case"e":return 10}break;case"a":switch(e[1]){case"v":return 5;case"d":return/(1|[^i]i|a|א)$/i.test(t)?12:13}break;case"ס":return 3;case"ט":return 10;case"ש":return 11;case"א":switch(e[1]){case"ב":return 5;case"ד":return/(1|[^i]i|a|א)$/i.test(t)?12:13;case"י":return 2;case"ל":return 6}break;case"ת":switch(e[1]){case"מ":return 4;case"ש":return 7}}throw new RangeError("Unable to parse month name: ".concat(t))}static dayOnOrBefore(t,e){return e-(e-t)%7}static isHDate(t){return null!==t&&"object"==typeof t&&"number"==typeof t.year&&"number"==typeof t.month&&"number"==typeof t.day&&"function"==typeof t.greg&&"function"==typeof t.abs}}function Sa(t){Ia(t),function(t){t.day<1&&(7==t.month&&(t.year-=1),t.day+=Ma.daysInMonth(t.month,t.year),t.month-=1,Sa(t));t.day>Ma.daysInMonth(t.month,t.year)&&(6==t.month&&(t.year+=1),t.day-=Ma.daysInMonth(t.month,t.year),t.month+=1,Sa(t));Ia(t)}(t)}function Ia(t){13!=t.month||t.isLeapYear()?t.month<1?(t.month+=Ma.monthsInYear(t.year),t.year-=1,Sa(t)):t.month>Ma.monthsInYear(t.year)&&(t.month-=Ma.monthsInYear(t.year),t.year+=1,Sa(t)):(t.month-=1,Sa(t)),delete t.abs0}function Oa(t,e,r){return new Ma(Ma.dayOnOrBefore(t,e.abs()+r))}var Da={headers:{"plural-forms":"nplurals=2; plural=(n > 1);",language:"he"},contexts:{"":{Adar:["אַדָר"],"Adar I":["אַדָר א׳"],"Adar II":["אַדָר ב׳"],Av:["אָב"],Cheshvan:["חֶשְׁוָן"],Elul:["אֱלוּל"],Iyyar:["אִיָיר"],Kislev:["כִּסְלֵו"],Nisan:["נִיסָן"],"Sh'vat":["שְׁבָט"],Sivan:["סִיוָן"],Tamuz:["תַּמּוּז"],Tevet:["טֵבֵת"],Tishrei:["תִשְׁרֵי"]}}};return ca.addLocale("he",Da),ca.addLocale("h",Da),t.HDate=Ma,t.Locale=ca,t.gematriya=ra,t.greg=ia,t.months={NISAN:1,IYYAR:2,SIVAN:3,TAMUZ:4,AV:5,ELUL:6,TISHREI:7,CHESHVAN:8,KISLEV:9,TEVET:10,SHVAT:11,ADAR_I:12,ADAR_II:13},t.version="3.28.0",Object.defineProperty(t,"__esModule",{value:!0}),t}({});
|
|
1
|
+
/*! @hebcal/core v3.29.2 */
|
|
2
|
+
var hebcal=function(e){"use strict";function t(e){switch(e){case 1:return"א";case 2:return"ב";case 3:return"ג";case 4:return"ד";case 5:return"ה";case 6:return"ו";case 7:return"ז";case 8:return"ח";case 9:return"ט";case 10:return"י";case 20:return"כ";case 30:return"ל";case 40:return"מ";case 50:return"נ";case 60:return"ס";case 70:return"ע";case 80:return"פ";case 90:return"צ";case 100:return"ק";case 200:return"ר";case 300:return"ש";case 400:return"ת";default:return"*INVALID*"}}function r(e){var r=parseInt(e,10);if(!r)throw new TypeError("invalid parameter to gematriya ".concat(e));var a=[];for(r%=1e3;r>0;){if(15===r||16===r){a.push(9),a.push(r-9);break}var n=100,o=void 0;for(o=400;o>r;o-=n)o===n&&(n/=10);a.push(o),r-=o}if(1==a.length)return t(a[0])+"׳";for(var s="",u=0;u<a.length;u++)u+1===a.length&&(s+="״"),s+=t(a[u]);return s}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var s=[[0,31,28,31,30,31,30,31,31,30,31,30,31],[0,31,29,31,30,31,30,31,31,30,31,30,31]];function u(e,t){return e-t*Math.floor(e/t)}function i(e,t){return Math.floor(e/t)}var c={monthNames:["","January","February","March","April","May","June","July","August","September","October","November","December"],isLeapYear:function(e){return!(e%4||!(e%100)&&e%400)},daysInMonth:function(e,t){return s[+this.isLeapYear(t)][e]},isDate:function(e){return"object"===a(e)&&Date.prototype===e.__proto__},dayOfYear:function(e){if(!this.isDate(e))throw new TypeError("Argument to greg.dayOfYear not a Date");var t=e.getDate()+31*e.getMonth();return e.getMonth()>1&&(t-=Math.floor((4*(e.getMonth()+1)+23)/10),this.isLeapYear(e.getFullYear())&&t++),t},greg2abs:function(e){if(!this.isDate(e))throw new TypeError("Argument to greg.greg2abs not a Date");var t=e.getFullYear()-1;return this.dayOfYear(e)+365*t+(Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))},yearFromFixed:function(e){var t=e-1,r=i(t,146097),a=u(t,146097),n=i(a,36524),o=u(a,36524),s=i(o,1461),c=i(u(o,1461),365),h=400*r+100*n+4*s+c;return 4!=n&&4!=c?h+1:h},toFixed:function(e,t,r){var a=e-1;return 0+365*a+i(a,4)-i(a,100)+i(a,400)+i(367*t-362,12)+Math.floor(t<=2?0:this.isLeapYear(e)?-1:-2)+r},abs2greg:function(e){if("number"!=typeof e)throw new TypeError("Argument to greg.abs2greg not a Number");e=Math.trunc(e);var t=this.yearFromFixed(e),r=i(12*(e-this.toFixed(t,1,1)+(e<this.toFixed(t,3,1)?0:this.isLeapYear(t)?1:2))+373,367),a=e-this.toFixed(t,r,1)+1,n=new Date(t,r-1,a);return t<100&&t>=0&&n.setFullYear(t),n}},h={headers:{"plural-forms":"nplurals=2; plural=(n!=1);"},contexts:{"":{}}},l={h:"he",a:"ashkenazi",s:"en","":"en"},y={locales:Object.create(null),activeLocale:null,activeName:null,lookupTranslation:function(e,t){var r=t&&t.toLowerCase(),a=("string"==typeof t&&this.locales[r]||this.activeLocale)[e];if(a&&a.length&&a[0].length)return a[0]},gettext:function(e,t){var r=this.lookupTranslation(e,t);return void 0===r?e:r},addLocale:function(e,t){if("object"!==a(t.contexts)||"object"!==a(t.contexts[""]))throw new TypeError("Locale '".concat(e,"' invalid compact format"));this.locales[e.toLowerCase()]=t.contexts[""]},useLocale:function(e){var t=e.toLowerCase(),r=this.locales[t];if(!r)throw new RangeError("Locale '".concat(e,"' not found"));return this.activeName=l[t]||t,this.activeLocale=r,this.activeLocale},getLocaleName:function(){return this.activeName},ordinal:function(e,t){var r=t&&t.toLowerCase()||this.activeName;if(!r)return this.getEnOrdinal(e);switch(r){case"en":case"s":case"a":case"ashkenazi":case"ashkenazi_litvish":case"ashkenazi_poylish":case"ashkenazi_standard":return this.getEnOrdinal(e);case"es":return e+"º";case"h":case"he":case"he-x-nonikud":return String(e);default:return e+"."}},getEnOrdinal:function(e){var t=["th","st","nd","rd"],r=e%100;return e+(t[(r-20)%10]||t[r]||t[0])},hebrewStripNikkud:function(e){return e.replace(/[\u0590-\u05bd]/g,"").replace(/[\u05bf-\u05c7]/g,"")}};y.addLocale("en",h),y.addLocale("s",h),y.addLocale("",h),y.useLocale("en");var f=["","Nisan","Iyyar","Sivan","Tamuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Sh'vat"],d=[f.concat(["Adar","Nisan"]),f.concat(["Adar I","Adar II","Nisan"])];function v(e){throw new TypeError(e)}var m=Object.create(null),g=-1373428,b="day",p="week",w="month",k="year",M={d:b,w:p,M:w,y:k},D={day:b,week:p,month:w,year:k},I=function(){function e(t,r,a){if(n(this,e),2==arguments.length||arguments.length>3)throw new TypeError("HDate constructor requires 0, 1 or 3 arguments");if(3==arguments.length){if(this.day=this.month=1,this.year=+a,isNaN(this.year))throw new TypeError("HDate called with bad year argument: ".concat(a));if(this.setMonth(r),this.setDate(+t),isNaN(this.day))throw new TypeError("HDate called with bad day argument: ".concat(t))}else{void 0===t&&(t=new Date);var o="number"!=typeof t||isNaN(t)?c.isDate(t)?c.greg2abs(t):e.isHDate(t)?{dd:t.day,mm:t.month,yy:t.year}:v("HDate called with bad argument: ".concat(t)):t,s="number"==typeof o,u=s?e.abs2hebrew(o):o;this.day=u.dd,this.month=u.mm,this.year=u.yy,s&&(this.abs0=o)}}var t,s,i;return t=e,s=[{key:"getFullYear",value:function(){return this.year}},{key:"isLeapYear",value:function(){return e.isLeapYear(this.year)}},{key:"getMonth",value:function(){return this.month}},{key:"getTishreiMonth",value:function(){var t=e.monthsInYear(this.getFullYear());return(this.getMonth()+t-6)%t||t}},{key:"daysInMonth",value:function(){return e.daysInMonth(this.getMonth(),this.getFullYear())}},{key:"getDate",value:function(){return this.day}},{key:"getDay",value:function(){return u(this.abs(),7)}},{key:"setFullYear",value:function(e){return this.year=e,Y(this),this}},{key:"setMonth",value:function(t){return this.month=e.monthNum(t),Y(this),this}},{key:"setDate",value:function(e){return this.day=e,Y(this),this}},{key:"greg",value:function(){return c.abs2greg(this.abs())}},{key:"abs",value:function(){return"number"!=typeof this.abs0&&(this.abs0=e.hebrew2abs(this.year,this.month,this.day)),this.abs0}},{key:"getMonthName",value:function(){return e.getMonthName(this.getMonth(),this.getFullYear())}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=t||y.getLocaleName(),n=this.getDate(),o=y.gettext(this.getMonthName(),a),s=y.ordinal(n,a),u=e.getDayOfTranslation(a),i="".concat(s).concat(u," ").concat(o);if(r){var c=this.getFullYear();return"".concat(i,", ").concat(c)}return i}},{key:"renderGematriya",value:function(){var e=this.getDate(),t=y.gettext(this.getMonthName(),"he"),a=this.getFullYear();return r(e)+" "+t+" "+r(a)}},{key:"before",value:function(e){return N(e,this,-1)}},{key:"onOrBefore",value:function(e){return N(e,this,0)}},{key:"nearest",value:function(e){return N(e,this,3)}},{key:"onOrAfter",value:function(e){return N(e,this,6)}},{key:"after",value:function(e){return N(e,this,7)}},{key:"next",value:function(){return new e(this.abs()+1)}},{key:"prev",value:function(){return new e(this.abs()-1)}},{key:"add",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"d";if(!(t=parseInt(t,10)))return new e(this);if((r=e.standardizeUnits(r))===b)return new e(this.abs()+t);if(r===p)return new e(this.abs()+7*t);if(r===k)return new e(this.getDate(),this.getMonth(),this.getFullYear()+t);if(r===w){var a=new e(this),n=t>0?1:-1;t=Math.abs(t);for(var o=0;o<t;o++)a=new e(a.abs()+n*a.daysInMonth());return a}}},{key:"subtract",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"d";return this.add(-1*e,t)}},{key:"deltaDays",value:function(t){if(!e.isHDate(t))throw new TypeError("Bad argument: ".concat(t));return this.abs()-t.abs()}},{key:"isSameDate",value:function(t){return!!e.isHDate(t)&&this.year==t.year&&this.month==t.month&&this.day==t.day}},{key:"toString",value:function(){var e=this.getDate(),t=this.getFullYear(),r=this.getMonthName();return"".concat(e," ").concat(r," ").concat(t)}}],i=[{key:"hebrew2abs",value:function(t,r,a){var n=a;if(r<7){for(var o=7;o<=e.monthsInYear(t);o++)n+=e.daysInMonth(o,t);for(var s=1;s<r;s++)n+=e.daysInMonth(s,t)}else for(var u=7;u<r;u++)n+=e.daysInMonth(u,t);return g+e.elapsedDays(t)+n-1}},{key:"newYear",value:function(t){return g+e.elapsedDays(t)+e.newYearDelay(t)}},{key:"newYearDelay",value:function(t){var r=e.elapsedDays(t);return e.elapsedDays(t+1)-r==356?2:r-e.elapsedDays(t-1)==382?1:0}},{key:"abs2hebrew",value:function(t){if("number"!=typeof t||isNaN(t))throw new TypeError("invalid parameter to abs2hebrew ".concat(t));t=Math.trunc(t);for(var r=Math.floor((t-g)/365.24682220597794);e.newYear(r)<=t;)++r;--r;for(var a=t<e.hebrew2abs(r,1,1)?7:1;t>e.hebrew2abs(r,a,e.daysInMonth(a,r));)++a;return{yy:r,mm:a,dd:1+t-e.hebrew2abs(r,a,1)}}},{key:"getDayOfTranslation",value:function(e){switch(e){case"en":case"s":case"a":case"ashkenazi":return" of"}var t=y.lookupTranslation("of",e);return t?" "+t:"ashkenazi"===e.substring(0,9)?" of":""}},{key:"standardizeUnits",value:function(e){var t=M[e]||String(e||"").toLowerCase().replace(/s$/,"");return D[t]||v("Invalid units '".concat(e,"'"))}},{key:"isLeapYear",value:function(e){return(1+7*e)%19<7}},{key:"monthsInYear",value:function(t){return 12+e.isLeapYear(t)}},{key:"daysInMonth",value:function(t,r){return 2==t||4==t||6==t||10==t||13==t||12==t&&!e.isLeapYear(r)||8==t&&!e.longCheshvan(r)||9==t&&e.shortKislev(r)?29:30}},{key:"getMonthName",value:function(t,r){if("number"!=typeof t||t<1||t>14)throw new TypeError("bad month argument ".concat(t));return d[+e.isLeapYear(r)][t]}},{key:"monthNum",value:function(t){return"number"==typeof t?t:t.charCodeAt(0)>=48&&t.charCodeAt(0)<=57?parseInt(t,10):e.monthFromName(t)}},{key:"elapsedDays",value:function(t){return m[t]=m[t]||e.elapsedDays0(t)}},{key:"elapsedDays0",value:function(t){var r=t-1,a=235*Math.floor(r/19)+r%19*12+Math.floor((r%19*7+1)/19),n=204+a%1080*793,o=5+12*a+793*Math.floor(a/1080)+Math.floor(n/1080),s=n%1080+o%24*1080,u=1+29*a+Math.floor(o/24),i=u+(s>=19440||2==u%7&&s>=9924&&!e.isLeapYear(t)||1==u%7&&s>=16789&&e.isLeapYear(r));return i+(i%7==0||i%7==3||i%7==5)}},{key:"daysInYear",value:function(t){return e.elapsedDays(t+1)-e.elapsedDays(t)}},{key:"longCheshvan",value:function(t){return e.daysInYear(t)%10==5}},{key:"shortKislev",value:function(t){return e.daysInYear(t)%10==3}},{key:"monthFromName",value:function(e){if("number"==typeof e)return e;var t=e.toLowerCase();switch(t[0]){case"n":case"נ":if("o"==t[1])break;return 1;case"i":return 2;case"e":return 6;case"c":case"ח":return 8;case"k":case"כ":return 9;case"s":switch(t[1]){case"i":return 3;case"h":return 11}case"t":switch(t[1]){case"a":return 4;case"i":return 7;case"e":return 10}break;case"a":switch(t[1]){case"v":return 5;case"d":return/(1|[^i]i|a|א)$/i.test(e)?12:13}break;case"ס":return 3;case"ט":return 10;case"ש":return 11;case"א":switch(t[1]){case"ב":return 5;case"ד":return/(1|[^i]i|a|א)$/i.test(e)?12:13;case"י":return 2;case"ל":return 6}break;case"ת":switch(t[1]){case"מ":return 4;case"ש":return 7}}throw new RangeError("Unable to parse month name: ".concat(e))}},{key:"dayOnOrBefore",value:function(e,t){return t-(t-e)%7}},{key:"isHDate",value:function(e){return null!==e&&"object"===a(e)&&"number"==typeof e.year&&"number"==typeof e.month&&"number"==typeof e.day&&"function"==typeof e.greg&&"function"==typeof e.abs}}],s&&o(t.prototype,s),i&&o(t,i),e}();function Y(e){L(e),function(e){e.day<1&&(7==e.month&&(e.year-=1),e.day+=I.daysInMonth(e.month,e.year),e.month-=1,Y(e));e.day>I.daysInMonth(e.month,e.year)&&(6==e.month&&(e.year+=1),e.day-=I.daysInMonth(e.month,e.year),e.month+=1,Y(e));L(e)}(e)}function L(e){13!=e.month||e.isLeapYear()?e.month<1?(e.month+=I.monthsInYear(e.year),e.year-=1,Y(e)):e.month>I.monthsInYear(e.year)&&(e.month-=I.monthsInYear(e.year),e.year+=1,Y(e)):(e.month-=1,Y(e)),delete e.abs0}function N(e,t,r){return new I(I.dayOnOrBefore(e,t.abs()+r))}var T={headers:{"plural-forms":"nplurals=2; plural=(n > 1);",language:"he"},contexts:{"":{Adar:["אַדָר"],"Adar I":["אַדָר א׳"],"Adar II":["אַדָר ב׳"],Av:["אָב"],Cheshvan:["חֶשְׁוָן"],Elul:["אֱלוּל"],Iyyar:["אִיָיר"],Kislev:["כִּסְלֵו"],Nisan:["נִיסָן"],"Sh'vat":["שְׁבָט"],Sivan:["סִיוָן"],Tamuz:["תַּמּוּז"],Tevet:["טֵבֵת"],Tishrei:["תִשְׁרֵי"]}}};return y.addLocale("he",T),y.addLocale("h",T),e.HDate=I,e.Locale=y,e.gematriya=r,e.greg=c,e.months={NISAN:1,IYYAR:2,SIVAN:3,TAMUZ:4,AV:5,ELUL:6,TISHREI:7,CHESHVAN:8,KISLEV:9,TEVET:10,SHVAT:11,ADAR_I:12,ADAR_II:13},e.version="3.29.2",Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
package/dist/hdate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v3.
|
|
1
|
+
/*! @hebcal/core v3.29.2 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -341,7 +341,7 @@ const alias = {
|
|
|
341
341
|
};
|
|
342
342
|
/**
|
|
343
343
|
* A locale in Hebcal is used for translations/transliterations of
|
|
344
|
-
* holidays. `@hebcal/core` supports
|
|
344
|
+
* holidays. `@hebcal/core` supports four locales by default
|
|
345
345
|
* * `en` - default, Sephardic transliterations (e.g. "Shabbat")
|
|
346
346
|
* * `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
|
|
347
347
|
* * `he` - Hebrew (e.g. "שַׁבָּת")
|
|
@@ -971,20 +971,9 @@ class HDate {
|
|
|
971
971
|
render(locale = null, showYear = true) {
|
|
972
972
|
const locale0 = locale || Locale.getLocaleName();
|
|
973
973
|
const day = this.getDate();
|
|
974
|
-
const monthName = Locale.gettext(this.getMonthName(),
|
|
974
|
+
const monthName = Locale.gettext(this.getMonthName(), locale0);
|
|
975
975
|
const nth = Locale.ordinal(day, locale0);
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
if (locale0 === 'en' || locale0 === 's' || 'ashkenazi' == locale0.substring(0, 9)) {
|
|
979
|
-
dayOf = ' of';
|
|
980
|
-
} else {
|
|
981
|
-
const ofStr = Locale.lookupTranslation('of', locale0);
|
|
982
|
-
|
|
983
|
-
if (ofStr) {
|
|
984
|
-
dayOf = ' ' + ofStr;
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
|
|
976
|
+
const dayOf = HDate.getDayOfTranslation(locale0);
|
|
988
977
|
const dateStr = `${nth}${dayOf} ${monthName}`;
|
|
989
978
|
|
|
990
979
|
if (showYear) {
|
|
@@ -994,6 +983,34 @@ class HDate {
|
|
|
994
983
|
return dateStr;
|
|
995
984
|
}
|
|
996
985
|
}
|
|
986
|
+
/**
|
|
987
|
+
* @private
|
|
988
|
+
* @param {string} locale
|
|
989
|
+
* @return {string}
|
|
990
|
+
*/
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
static getDayOfTranslation(locale) {
|
|
994
|
+
switch (locale) {
|
|
995
|
+
case 'en':
|
|
996
|
+
case 's':
|
|
997
|
+
case 'a':
|
|
998
|
+
case 'ashkenazi':
|
|
999
|
+
return ' of';
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
const ofStr = Locale.lookupTranslation('of', locale);
|
|
1003
|
+
|
|
1004
|
+
if (ofStr) {
|
|
1005
|
+
return ' ' + ofStr;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
if ('ashkenazi' === locale.substring(0, 9)) {
|
|
1009
|
+
return ' of';
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
return '';
|
|
1013
|
+
}
|
|
997
1014
|
/**
|
|
998
1015
|
* Renders this Hebrew date in Hebrew gematriya, regardless of locale.
|
|
999
1016
|
* @example
|
|
@@ -1599,7 +1616,7 @@ function onOrBefore(day, t, offset) {
|
|
|
1599
1616
|
return new HDate(HDate.dayOnOrBefore(day, t.abs() + offset));
|
|
1600
1617
|
}
|
|
1601
1618
|
|
|
1602
|
-
var version="3.
|
|
1619
|
+
var version="3.29.2";
|
|
1603
1620
|
|
|
1604
1621
|
var headers={"plural-forms":"nplurals=2; plural=(n > 1);",language:"he"};var contexts={"":{Adar:["אַדָר"],"Adar I":["אַדָר א׳"],"Adar II":["אַדָר ב׳"],Av:["אָב"],Cheshvan:["חֶשְׁוָן"],Elul:["אֱלוּל"],Iyyar:["אִיָיר"],Kislev:["כִּסְלֵו"],Nisan:["נִיסָן"],"Sh'vat":["שְׁבָט"],Sivan:["סִיוָן"],Tamuz:["תַּמּוּז"],Tevet:["טֵבֵת"],Tishrei:["תִשְׁרֵי"]}};var poHeMin = {headers:headers,contexts:contexts};
|
|
1605
1622
|
|
package/dist/hdate.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v3.
|
|
1
|
+
/*! @hebcal/core v3.29.2 */
|
|
2
2
|
const GERESH = '׳';
|
|
3
3
|
const GERSHAYIM = '״';
|
|
4
4
|
/**
|
|
@@ -337,7 +337,7 @@ const alias = {
|
|
|
337
337
|
};
|
|
338
338
|
/**
|
|
339
339
|
* A locale in Hebcal is used for translations/transliterations of
|
|
340
|
-
* holidays. `@hebcal/core` supports
|
|
340
|
+
* holidays. `@hebcal/core` supports four locales by default
|
|
341
341
|
* * `en` - default, Sephardic transliterations (e.g. "Shabbat")
|
|
342
342
|
* * `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
|
|
343
343
|
* * `he` - Hebrew (e.g. "שַׁבָּת")
|
|
@@ -967,20 +967,9 @@ class HDate {
|
|
|
967
967
|
render(locale = null, showYear = true) {
|
|
968
968
|
const locale0 = locale || Locale.getLocaleName();
|
|
969
969
|
const day = this.getDate();
|
|
970
|
-
const monthName = Locale.gettext(this.getMonthName(),
|
|
970
|
+
const monthName = Locale.gettext(this.getMonthName(), locale0);
|
|
971
971
|
const nth = Locale.ordinal(day, locale0);
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
if (locale0 === 'en' || locale0 === 's' || 'ashkenazi' == locale0.substring(0, 9)) {
|
|
975
|
-
dayOf = ' of';
|
|
976
|
-
} else {
|
|
977
|
-
const ofStr = Locale.lookupTranslation('of', locale0);
|
|
978
|
-
|
|
979
|
-
if (ofStr) {
|
|
980
|
-
dayOf = ' ' + ofStr;
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
|
|
972
|
+
const dayOf = HDate.getDayOfTranslation(locale0);
|
|
984
973
|
const dateStr = `${nth}${dayOf} ${monthName}`;
|
|
985
974
|
|
|
986
975
|
if (showYear) {
|
|
@@ -990,6 +979,34 @@ class HDate {
|
|
|
990
979
|
return dateStr;
|
|
991
980
|
}
|
|
992
981
|
}
|
|
982
|
+
/**
|
|
983
|
+
* @private
|
|
984
|
+
* @param {string} locale
|
|
985
|
+
* @return {string}
|
|
986
|
+
*/
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
static getDayOfTranslation(locale) {
|
|
990
|
+
switch (locale) {
|
|
991
|
+
case 'en':
|
|
992
|
+
case 's':
|
|
993
|
+
case 'a':
|
|
994
|
+
case 'ashkenazi':
|
|
995
|
+
return ' of';
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
const ofStr = Locale.lookupTranslation('of', locale);
|
|
999
|
+
|
|
1000
|
+
if (ofStr) {
|
|
1001
|
+
return ' ' + ofStr;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
if ('ashkenazi' === locale.substring(0, 9)) {
|
|
1005
|
+
return ' of';
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
return '';
|
|
1009
|
+
}
|
|
993
1010
|
/**
|
|
994
1011
|
* Renders this Hebrew date in Hebrew gematriya, regardless of locale.
|
|
995
1012
|
* @example
|
|
@@ -1595,7 +1612,7 @@ function onOrBefore(day, t, offset) {
|
|
|
1595
1612
|
return new HDate(HDate.dayOnOrBefore(day, t.abs() + offset));
|
|
1596
1613
|
}
|
|
1597
1614
|
|
|
1598
|
-
var version="3.
|
|
1615
|
+
var version="3.29.2";
|
|
1599
1616
|
|
|
1600
1617
|
var headers={"plural-forms":"nplurals=2; plural=(n > 1);",language:"he"};var contexts={"":{Adar:["אַדָר"],"Adar I":["אַדָר א׳"],"Adar II":["אַדָר ב׳"],Av:["אָב"],Cheshvan:["חֶשְׁוָן"],Elul:["אֱלוּל"],Iyyar:["אִיָיר"],Kislev:["כִּסְלֵו"],Nisan:["נִיסָן"],"Sh'vat":["שְׁבָט"],Sivan:["סִיוָן"],Tamuz:["תַּמּוּז"],Tevet:["טֵבֵת"],Tishrei:["תִשְׁרֵי"]}};var poHeMin = {headers:headers,contexts:contexts};
|
|
1601
1618
|
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v3.
|
|
1
|
+
/*! @hebcal/core v3.29.2 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -341,7 +341,7 @@ const alias = {
|
|
|
341
341
|
};
|
|
342
342
|
/**
|
|
343
343
|
* A locale in Hebcal is used for translations/transliterations of
|
|
344
|
-
* holidays. `@hebcal/core` supports
|
|
344
|
+
* holidays. `@hebcal/core` supports four locales by default
|
|
345
345
|
* * `en` - default, Sephardic transliterations (e.g. "Shabbat")
|
|
346
346
|
* * `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
|
|
347
347
|
* * `he` - Hebrew (e.g. "שַׁבָּת")
|
|
@@ -971,20 +971,9 @@ class HDate$1 {
|
|
|
971
971
|
render(locale = null, showYear = true) {
|
|
972
972
|
const locale0 = locale || Locale.getLocaleName();
|
|
973
973
|
const day = this.getDate();
|
|
974
|
-
const monthName = Locale.gettext(this.getMonthName(),
|
|
974
|
+
const monthName = Locale.gettext(this.getMonthName(), locale0);
|
|
975
975
|
const nth = Locale.ordinal(day, locale0);
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
if (locale0 === 'en' || locale0 === 's' || 'ashkenazi' == locale0.substring(0, 9)) {
|
|
979
|
-
dayOf = ' of';
|
|
980
|
-
} else {
|
|
981
|
-
const ofStr = Locale.lookupTranslation('of', locale0);
|
|
982
|
-
|
|
983
|
-
if (ofStr) {
|
|
984
|
-
dayOf = ' ' + ofStr;
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
|
|
976
|
+
const dayOf = HDate$1.getDayOfTranslation(locale0);
|
|
988
977
|
const dateStr = `${nth}${dayOf} ${monthName}`;
|
|
989
978
|
|
|
990
979
|
if (showYear) {
|
|
@@ -994,6 +983,34 @@ class HDate$1 {
|
|
|
994
983
|
return dateStr;
|
|
995
984
|
}
|
|
996
985
|
}
|
|
986
|
+
/**
|
|
987
|
+
* @private
|
|
988
|
+
* @param {string} locale
|
|
989
|
+
* @return {string}
|
|
990
|
+
*/
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
static getDayOfTranslation(locale) {
|
|
994
|
+
switch (locale) {
|
|
995
|
+
case 'en':
|
|
996
|
+
case 's':
|
|
997
|
+
case 'a':
|
|
998
|
+
case 'ashkenazi':
|
|
999
|
+
return ' of';
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
const ofStr = Locale.lookupTranslation('of', locale);
|
|
1003
|
+
|
|
1004
|
+
if (ofStr) {
|
|
1005
|
+
return ' ' + ofStr;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
if ('ashkenazi' === locale.substring(0, 9)) {
|
|
1009
|
+
return ' of';
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
return '';
|
|
1013
|
+
}
|
|
997
1014
|
/**
|
|
998
1015
|
* Renders this Hebrew date in Hebrew gematriya, regardless of locale.
|
|
999
1016
|
* @example
|
|
@@ -1882,9 +1899,22 @@ class HebrewDateEvent extends Event {
|
|
|
1882
1899
|
|
|
1883
1900
|
|
|
1884
1901
|
render(locale) {
|
|
1885
|
-
const
|
|
1902
|
+
const locale1 = locale && locale.toLowerCase();
|
|
1903
|
+
const locale0 = locale1 || Locale.getLocaleName();
|
|
1886
1904
|
const hd = this.getDate();
|
|
1887
|
-
|
|
1905
|
+
|
|
1906
|
+
switch (locale0) {
|
|
1907
|
+
case 'h':
|
|
1908
|
+
case 'he':
|
|
1909
|
+
case 'he-x-nonikud':
|
|
1910
|
+
const dd = hd.getDate();
|
|
1911
|
+
const mm = Locale.gettext(hd.getMonthName(), locale0);
|
|
1912
|
+
const yy = hd.getFullYear();
|
|
1913
|
+
return gematriya(dd) + ' ' + mm + ' ' + gematriya(yy);
|
|
1914
|
+
|
|
1915
|
+
default:
|
|
1916
|
+
return hd.render(locale0, true);
|
|
1917
|
+
}
|
|
1888
1918
|
}
|
|
1889
1919
|
/**
|
|
1890
1920
|
* @param {string} [locale] Optional locale name (defaults to active locale).
|
|
@@ -1900,20 +1930,25 @@ class HebrewDateEvent extends Event {
|
|
|
1900
1930
|
|
|
1901
1931
|
|
|
1902
1932
|
renderBrief(locale) {
|
|
1903
|
-
const
|
|
1933
|
+
const locale1 = locale && locale.toLowerCase();
|
|
1934
|
+
const locale0 = locale1 || Locale.getLocaleName();
|
|
1904
1935
|
const hd = this.getDate();
|
|
1905
1936
|
|
|
1906
1937
|
if (hd.getMonth() === months.TISHREI && hd.getDate() === 1) {
|
|
1907
1938
|
return this.render(locale0);
|
|
1908
1939
|
}
|
|
1909
1940
|
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1941
|
+
switch (locale0) {
|
|
1942
|
+
case 'h':
|
|
1943
|
+
case 'he':
|
|
1944
|
+
case 'he-x-nonikud':
|
|
1945
|
+
const dd = hd.getDate();
|
|
1946
|
+
const mm = Locale.gettext(hd.getMonthName(), locale0);
|
|
1947
|
+
return gematriya(dd) + ' ' + mm;
|
|
1913
1948
|
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1949
|
+
default:
|
|
1950
|
+
return hd.render(locale0, false);
|
|
1951
|
+
}
|
|
1917
1952
|
}
|
|
1918
1953
|
/**
|
|
1919
1954
|
* Helper function to render a Hebrew date
|
|
@@ -4649,9 +4684,9 @@ function getHolidaysForYear(year) {
|
|
|
4649
4684
|
return h;
|
|
4650
4685
|
}
|
|
4651
4686
|
|
|
4652
|
-
var version="3.
|
|
4687
|
+
var version="3.29.2";
|
|
4653
4688
|
|
|
4654
|
-
var headers$1={"plural-forms":"nplurals=2; plural=(n > 1);",language:"en_CA@ashkenazi"};var contexts$1={"":{Berachot:["Berachos"],Shabbat:["Shabbos"],Taanit:["Taanis"],Yevamot:["Yevamos"],Ketubot:["Kesubos"],"Baba Batra":["Baba Basra"],Makkot:["Makkos"],Shevuot:["Shevuos"],Horayot:["Horayos"],Menachot:["Menachos"],Bechorot:["Bechoros"],Keritot:["Kerisos"],Midot:["Midos"],"Achrei Mot":["Achrei Mos"],Bechukotai:["Bechukosai"],"Beha'alotcha":["Beha'aloscha"],Bereshit:["Bereshis"],Chukat:["Chukas"],"Erev Shavuot":["Erev Shavuos"],"Erev Sukkot":["Erev Sukkos"],"Ki Tavo":["Ki Savo"],"Ki Teitzei":["Ki Seitzei"],"Ki Tisa":["Ki Sisa"],Matot:["Matos"],"Purim Katan":["Purim Koton"],Tazria:["Sazria"],"Shabbat Chazon":["Shabbos Chazon"],"Shabbat HaChodesh":["Shabbos HaChodesh"],"Shabbat HaGadol":["Shabbos HaGadol"],"Shabbat Nachamu":["Shabbos Nachamu"],"Shabbat Parah":["Shabbos Parah"],"Shabbat Shekalim":["Shabbos Shekalim"],"Shabbat Shuva":["Shabbos Shuvah"],"Shabbat Zachor":["Shabbos Zachor"],Shavuot:["Shavuos"],"Shavuot I":["Shavuos I"],"Shavuot II":["Shavuos II"],Shemot:["Shemos"],"Shmini Atzeret":["Shmini Atzeres"],"Simchat Torah":["Simchas Torah"],Sukkot:["Sukkos"],"Sukkot I":["Sukkos I"],"Sukkot II":["Sukkos II"],"Sukkot II (CH''M)":["Sukkos II (CH''M)"],"Sukkot III (CH''M)":["Sukkos III (CH''M)"],"Sukkot IV (CH''M)":["Sukkos IV (CH''M)"],"Sukkot V (CH''M)":["Sukkos V (CH''M)"],"Sukkot VI (CH''M)":["Sukkos VI (CH''M)"],"Sukkot VII (Hoshana Raba)":["Sukkos VII (Hoshana Raba)"],"Ta'anit Bechorot":["Ta'anis Bechoros"],"Ta'anit Esther":["Ta'anis Esther"],Toldot:["Toldos"],Vaetchanan:["Vaeschanan"],Yitro:["Yisro"],"Vezot Haberakhah":["Vezos Haberakhah"],Parashat:["Parshas"],"Leil Selichot":["Leil Selichos"],"Shabbat Mevarchim Chodesh":["Shabbos Mevorchim Chodesh"],"Shabbat Shirah":["Shabbos Shirah"]}};var poAshkenazi = {headers:headers$1,contexts:contexts$1};
|
|
4689
|
+
var headers$1={"plural-forms":"nplurals=2; plural=(n > 1);",language:"en_CA@ashkenazi"};var contexts$1={"":{Berachot:["Berachos"],Shabbat:["Shabbos"],Taanit:["Taanis"],Yevamot:["Yevamos"],Ketubot:["Kesubos"],"Baba Batra":["Baba Basra"],Makkot:["Makkos"],Shevuot:["Shevuos"],Horayot:["Horayos"],Menachot:["Menachos"],Bechorot:["Bechoros"],Keritot:["Kerisos"],Midot:["Midos"],"Achrei Mot":["Achrei Mos"],Bechukotai:["Bechukosai"],"Beha'alotcha":["Beha'aloscha"],Bereshit:["Bereshis"],Chukat:["Chukas"],"Erev Shavuot":["Erev Shavuos"],"Erev Sukkot":["Erev Sukkos"],"Ki Tavo":["Ki Savo"],"Ki Teitzei":["Ki Seitzei"],"Ki Tisa":["Ki Sisa"],Matot:["Matos"],"Purim Katan":["Purim Koton"],Tazria:["Sazria"],"Shabbat Chazon":["Shabbos Chazon"],"Shabbat HaChodesh":["Shabbos HaChodesh"],"Shabbat HaGadol":["Shabbos HaGadol"],"Shabbat Nachamu":["Shabbos Nachamu"],"Shabbat Parah":["Shabbos Parah"],"Shabbat Shekalim":["Shabbos Shekalim"],"Shabbat Shuva":["Shabbos Shuvah"],"Shabbat Zachor":["Shabbos Zachor"],Shavuot:["Shavuos"],"Shavuot I":["Shavuos I"],"Shavuot II":["Shavuos II"],Shemot:["Shemos"],"Shmini Atzeret":["Shmini Atzeres"],"Simchat Torah":["Simchas Torah"],Sukkot:["Sukkos"],"Sukkot I":["Sukkos I"],"Sukkot II":["Sukkos II"],"Sukkot II (CH''M)":["Sukkos II (CH''M)"],"Sukkot III (CH''M)":["Sukkos III (CH''M)"],"Sukkot IV (CH''M)":["Sukkos IV (CH''M)"],"Sukkot V (CH''M)":["Sukkos V (CH''M)"],"Sukkot VI (CH''M)":["Sukkos VI (CH''M)"],"Sukkot VII (Hoshana Raba)":["Sukkos VII (Hoshana Raba)"],"Ta'anit Bechorot":["Ta'anis Bechoros"],"Ta'anit Esther":["Ta'anis Esther"],Toldot:["Toldos"],Vaetchanan:["Vaeschanan"],Yitro:["Yisro"],"Vezot Haberakhah":["Vezos Haberakhah"],Parashat:["Parshas"],"Leil Selichot":["Leil Selichos"],"Shabbat Mevarchim Chodesh":["Shabbos Mevorchim Chodesh"],"Shabbat Shirah":["Shabbos Shirah"],Tevet:["Teves"],"Asara B'Tevet":["Asara B'Teves"]}};var poAshkenazi = {headers:headers$1,contexts:contexts$1};
|
|
4655
4690
|
|
|
4656
4691
|
Locale.addLocale('ashkenazi', poAshkenazi);
|
|
4657
4692
|
Locale.addLocale('a', poAshkenazi);
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v3.
|
|
1
|
+
/*! @hebcal/core v3.29.2 */
|
|
2
2
|
/*
|
|
3
3
|
Hebcal - A Jewish Calendar Generator
|
|
4
4
|
Copyright (c) 1994-2020 Danny Sadinoff
|
|
@@ -337,7 +337,7 @@ const alias = {
|
|
|
337
337
|
};
|
|
338
338
|
/**
|
|
339
339
|
* A locale in Hebcal is used for translations/transliterations of
|
|
340
|
-
* holidays. `@hebcal/core` supports
|
|
340
|
+
* holidays. `@hebcal/core` supports four locales by default
|
|
341
341
|
* * `en` - default, Sephardic transliterations (e.g. "Shabbat")
|
|
342
342
|
* * `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
|
|
343
343
|
* * `he` - Hebrew (e.g. "שַׁבָּת")
|
|
@@ -967,20 +967,9 @@ class HDate$1 {
|
|
|
967
967
|
render(locale = null, showYear = true) {
|
|
968
968
|
const locale0 = locale || Locale.getLocaleName();
|
|
969
969
|
const day = this.getDate();
|
|
970
|
-
const monthName = Locale.gettext(this.getMonthName(),
|
|
970
|
+
const monthName = Locale.gettext(this.getMonthName(), locale0);
|
|
971
971
|
const nth = Locale.ordinal(day, locale0);
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
if (locale0 === 'en' || locale0 === 's' || 'ashkenazi' == locale0.substring(0, 9)) {
|
|
975
|
-
dayOf = ' of';
|
|
976
|
-
} else {
|
|
977
|
-
const ofStr = Locale.lookupTranslation('of', locale0);
|
|
978
|
-
|
|
979
|
-
if (ofStr) {
|
|
980
|
-
dayOf = ' ' + ofStr;
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
|
|
972
|
+
const dayOf = HDate$1.getDayOfTranslation(locale0);
|
|
984
973
|
const dateStr = `${nth}${dayOf} ${monthName}`;
|
|
985
974
|
|
|
986
975
|
if (showYear) {
|
|
@@ -990,6 +979,34 @@ class HDate$1 {
|
|
|
990
979
|
return dateStr;
|
|
991
980
|
}
|
|
992
981
|
}
|
|
982
|
+
/**
|
|
983
|
+
* @private
|
|
984
|
+
* @param {string} locale
|
|
985
|
+
* @return {string}
|
|
986
|
+
*/
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
static getDayOfTranslation(locale) {
|
|
990
|
+
switch (locale) {
|
|
991
|
+
case 'en':
|
|
992
|
+
case 's':
|
|
993
|
+
case 'a':
|
|
994
|
+
case 'ashkenazi':
|
|
995
|
+
return ' of';
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
const ofStr = Locale.lookupTranslation('of', locale);
|
|
999
|
+
|
|
1000
|
+
if (ofStr) {
|
|
1001
|
+
return ' ' + ofStr;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
if ('ashkenazi' === locale.substring(0, 9)) {
|
|
1005
|
+
return ' of';
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
return '';
|
|
1009
|
+
}
|
|
993
1010
|
/**
|
|
994
1011
|
* Renders this Hebrew date in Hebrew gematriya, regardless of locale.
|
|
995
1012
|
* @example
|
|
@@ -1878,9 +1895,22 @@ class HebrewDateEvent extends Event {
|
|
|
1878
1895
|
|
|
1879
1896
|
|
|
1880
1897
|
render(locale) {
|
|
1881
|
-
const
|
|
1898
|
+
const locale1 = locale && locale.toLowerCase();
|
|
1899
|
+
const locale0 = locale1 || Locale.getLocaleName();
|
|
1882
1900
|
const hd = this.getDate();
|
|
1883
|
-
|
|
1901
|
+
|
|
1902
|
+
switch (locale0) {
|
|
1903
|
+
case 'h':
|
|
1904
|
+
case 'he':
|
|
1905
|
+
case 'he-x-nonikud':
|
|
1906
|
+
const dd = hd.getDate();
|
|
1907
|
+
const mm = Locale.gettext(hd.getMonthName(), locale0);
|
|
1908
|
+
const yy = hd.getFullYear();
|
|
1909
|
+
return gematriya(dd) + ' ' + mm + ' ' + gematriya(yy);
|
|
1910
|
+
|
|
1911
|
+
default:
|
|
1912
|
+
return hd.render(locale0, true);
|
|
1913
|
+
}
|
|
1884
1914
|
}
|
|
1885
1915
|
/**
|
|
1886
1916
|
* @param {string} [locale] Optional locale name (defaults to active locale).
|
|
@@ -1896,20 +1926,25 @@ class HebrewDateEvent extends Event {
|
|
|
1896
1926
|
|
|
1897
1927
|
|
|
1898
1928
|
renderBrief(locale) {
|
|
1899
|
-
const
|
|
1929
|
+
const locale1 = locale && locale.toLowerCase();
|
|
1930
|
+
const locale0 = locale1 || Locale.getLocaleName();
|
|
1900
1931
|
const hd = this.getDate();
|
|
1901
1932
|
|
|
1902
1933
|
if (hd.getMonth() === months.TISHREI && hd.getDate() === 1) {
|
|
1903
1934
|
return this.render(locale0);
|
|
1904
1935
|
}
|
|
1905
1936
|
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1937
|
+
switch (locale0) {
|
|
1938
|
+
case 'h':
|
|
1939
|
+
case 'he':
|
|
1940
|
+
case 'he-x-nonikud':
|
|
1941
|
+
const dd = hd.getDate();
|
|
1942
|
+
const mm = Locale.gettext(hd.getMonthName(), locale0);
|
|
1943
|
+
return gematriya(dd) + ' ' + mm;
|
|
1909
1944
|
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1945
|
+
default:
|
|
1946
|
+
return hd.render(locale0, false);
|
|
1947
|
+
}
|
|
1913
1948
|
}
|
|
1914
1949
|
/**
|
|
1915
1950
|
* Helper function to render a Hebrew date
|
|
@@ -4645,9 +4680,9 @@ function getHolidaysForYear(year) {
|
|
|
4645
4680
|
return h;
|
|
4646
4681
|
}
|
|
4647
4682
|
|
|
4648
|
-
var version="3.
|
|
4683
|
+
var version="3.29.2";
|
|
4649
4684
|
|
|
4650
|
-
var headers$1={"plural-forms":"nplurals=2; plural=(n > 1);",language:"en_CA@ashkenazi"};var contexts$1={"":{Berachot:["Berachos"],Shabbat:["Shabbos"],Taanit:["Taanis"],Yevamot:["Yevamos"],Ketubot:["Kesubos"],"Baba Batra":["Baba Basra"],Makkot:["Makkos"],Shevuot:["Shevuos"],Horayot:["Horayos"],Menachot:["Menachos"],Bechorot:["Bechoros"],Keritot:["Kerisos"],Midot:["Midos"],"Achrei Mot":["Achrei Mos"],Bechukotai:["Bechukosai"],"Beha'alotcha":["Beha'aloscha"],Bereshit:["Bereshis"],Chukat:["Chukas"],"Erev Shavuot":["Erev Shavuos"],"Erev Sukkot":["Erev Sukkos"],"Ki Tavo":["Ki Savo"],"Ki Teitzei":["Ki Seitzei"],"Ki Tisa":["Ki Sisa"],Matot:["Matos"],"Purim Katan":["Purim Koton"],Tazria:["Sazria"],"Shabbat Chazon":["Shabbos Chazon"],"Shabbat HaChodesh":["Shabbos HaChodesh"],"Shabbat HaGadol":["Shabbos HaGadol"],"Shabbat Nachamu":["Shabbos Nachamu"],"Shabbat Parah":["Shabbos Parah"],"Shabbat Shekalim":["Shabbos Shekalim"],"Shabbat Shuva":["Shabbos Shuvah"],"Shabbat Zachor":["Shabbos Zachor"],Shavuot:["Shavuos"],"Shavuot I":["Shavuos I"],"Shavuot II":["Shavuos II"],Shemot:["Shemos"],"Shmini Atzeret":["Shmini Atzeres"],"Simchat Torah":["Simchas Torah"],Sukkot:["Sukkos"],"Sukkot I":["Sukkos I"],"Sukkot II":["Sukkos II"],"Sukkot II (CH''M)":["Sukkos II (CH''M)"],"Sukkot III (CH''M)":["Sukkos III (CH''M)"],"Sukkot IV (CH''M)":["Sukkos IV (CH''M)"],"Sukkot V (CH''M)":["Sukkos V (CH''M)"],"Sukkot VI (CH''M)":["Sukkos VI (CH''M)"],"Sukkot VII (Hoshana Raba)":["Sukkos VII (Hoshana Raba)"],"Ta'anit Bechorot":["Ta'anis Bechoros"],"Ta'anit Esther":["Ta'anis Esther"],Toldot:["Toldos"],Vaetchanan:["Vaeschanan"],Yitro:["Yisro"],"Vezot Haberakhah":["Vezos Haberakhah"],Parashat:["Parshas"],"Leil Selichot":["Leil Selichos"],"Shabbat Mevarchim Chodesh":["Shabbos Mevorchim Chodesh"],"Shabbat Shirah":["Shabbos Shirah"]}};var poAshkenazi = {headers:headers$1,contexts:contexts$1};
|
|
4685
|
+
var headers$1={"plural-forms":"nplurals=2; plural=(n > 1);",language:"en_CA@ashkenazi"};var contexts$1={"":{Berachot:["Berachos"],Shabbat:["Shabbos"],Taanit:["Taanis"],Yevamot:["Yevamos"],Ketubot:["Kesubos"],"Baba Batra":["Baba Basra"],Makkot:["Makkos"],Shevuot:["Shevuos"],Horayot:["Horayos"],Menachot:["Menachos"],Bechorot:["Bechoros"],Keritot:["Kerisos"],Midot:["Midos"],"Achrei Mot":["Achrei Mos"],Bechukotai:["Bechukosai"],"Beha'alotcha":["Beha'aloscha"],Bereshit:["Bereshis"],Chukat:["Chukas"],"Erev Shavuot":["Erev Shavuos"],"Erev Sukkot":["Erev Sukkos"],"Ki Tavo":["Ki Savo"],"Ki Teitzei":["Ki Seitzei"],"Ki Tisa":["Ki Sisa"],Matot:["Matos"],"Purim Katan":["Purim Koton"],Tazria:["Sazria"],"Shabbat Chazon":["Shabbos Chazon"],"Shabbat HaChodesh":["Shabbos HaChodesh"],"Shabbat HaGadol":["Shabbos HaGadol"],"Shabbat Nachamu":["Shabbos Nachamu"],"Shabbat Parah":["Shabbos Parah"],"Shabbat Shekalim":["Shabbos Shekalim"],"Shabbat Shuva":["Shabbos Shuvah"],"Shabbat Zachor":["Shabbos Zachor"],Shavuot:["Shavuos"],"Shavuot I":["Shavuos I"],"Shavuot II":["Shavuos II"],Shemot:["Shemos"],"Shmini Atzeret":["Shmini Atzeres"],"Simchat Torah":["Simchas Torah"],Sukkot:["Sukkos"],"Sukkot I":["Sukkos I"],"Sukkot II":["Sukkos II"],"Sukkot II (CH''M)":["Sukkos II (CH''M)"],"Sukkot III (CH''M)":["Sukkos III (CH''M)"],"Sukkot IV (CH''M)":["Sukkos IV (CH''M)"],"Sukkot V (CH''M)":["Sukkos V (CH''M)"],"Sukkot VI (CH''M)":["Sukkos VI (CH''M)"],"Sukkot VII (Hoshana Raba)":["Sukkos VII (Hoshana Raba)"],"Ta'anit Bechorot":["Ta'anis Bechoros"],"Ta'anit Esther":["Ta'anis Esther"],Toldot:["Toldos"],Vaetchanan:["Vaeschanan"],Yitro:["Yisro"],"Vezot Haberakhah":["Vezos Haberakhah"],Parashat:["Parshas"],"Leil Selichot":["Leil Selichos"],"Shabbat Mevarchim Chodesh":["Shabbos Mevorchim Chodesh"],"Shabbat Shirah":["Shabbos Shirah"],Tevet:["Teves"],"Asara B'Tevet":["Asara B'Teves"]}};var poAshkenazi = {headers:headers$1,contexts:contexts$1};
|
|
4651
4686
|
|
|
4652
4687
|
Locale.addLocale('ashkenazi', poAshkenazi);
|
|
4653
4688
|
Locale.addLocale('a', poAshkenazi);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.29.2",
|
|
4
4
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Eyal Schachter (https://github.com/Scimonster)",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@ava/babel": "^2.0.0",
|
|
73
73
|
"@babel/core": "^7.16.0",
|
|
74
|
-
"@babel/preset-env": "^7.16.
|
|
74
|
+
"@babel/preset-env": "^7.16.4",
|
|
75
75
|
"@babel/register": "^7.16.0",
|
|
76
76
|
"@hebcal/solar-calc": "^1.0.6",
|
|
77
77
|
"@rollup/plugin-babel": "^5.3.0",
|
|
@@ -80,12 +80,12 @@
|
|
|
80
80
|
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
81
81
|
"ava": "^3.15.0",
|
|
82
82
|
"core-js": "^3.19.1",
|
|
83
|
-
"eslint": "^8.
|
|
83
|
+
"eslint": "^8.3.0",
|
|
84
84
|
"eslint-config-google": "^0.14.0",
|
|
85
85
|
"jsdoc": "^3.6.7",
|
|
86
86
|
"jsdoc-to-markdown": "^7.1.0",
|
|
87
87
|
"nyc": "^15.1.0",
|
|
88
|
-
"rollup": "^2.
|
|
88
|
+
"rollup": "^2.60.1",
|
|
89
89
|
"rollup-plugin-terser": "^7.0.2",
|
|
90
90
|
"tsd-jsdoc": "^2.5.0",
|
|
91
91
|
"ttag-cli": "^1.9.3"
|