@hebcal/core 3.36.2 → 3.37.0
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/bundle.js +332 -153
- package/dist/bundle.min.js +2 -2
- package/dist/hdate-bundle.js +2 -2
- package/dist/hdate-bundle.min.js +2 -2
- package/dist/hdate.js +2 -2
- package/dist/hdate.mjs +2 -2
- package/dist/index.js +94 -5
- package/dist/index.mjs +94 -5
- package/package.json +11 -9
package/dist/hdate-bundle.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @hebcal/core v3.
|
|
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 a(e){for(var t=[];e>0;){if(15===e||16===e){t.push(9),t.push(e-9);break}var a=100,r=void 0;for(r=400;r>e;r-=a)r===a&&(a/=10);t.push(r),e-=r}return t}function r(e){var r=parseInt(e,10);if(!r)throw new TypeError("invalid parameter to gematriya ".concat(e));var n="",o=Math.floor(r/1e3);if(o>0&&5!==o){for(var s=a(o),u=0;u<s.length;u++)n+=t(s[u]);n+="׳"}var i=a(r%1e3);if(1==i.length)return n+t(i[0])+"׳";for(var h=0;h<i.length;h++)h+1===i.length&&(n+="״"),n+=t(i[h]);return n}function n(e){return n="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},n(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,a){return t&&s(e.prototype,t),a&&s(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var h=[[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 c(e,t){return e-t*Math.floor(e/t)}function l(e,t){return Math.floor(e/t)}var y=function(){function e(){o(this,e)}return u(e,null,[{key:"isLeapYear",value:function(e){return!(e%4||!(e%100)&&e%400)}},{key:"daysInMonth",value:function(e,t){return h[+this.isLeapYear(t)][e]}},{key:"isDate",value:function(e){return"object"===n(e)&&Date.prototype===e.__proto__}},{key:"dayOfYear",value: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}},{key:"greg2abs",value: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))}},{key:"yearFromFixed",value:function(e){var t=e-1,a=l(t,146097),r=c(t,146097),n=l(r,36524),o=c(r,36524),s=l(o,1461),u=l(c(o,1461),365),i=400*a+100*n+4*s+u;return 4!=n&&4!=u?i+1:i}},{key:"toFixed",value:function(e,t,a){var r=e-1;return 0+365*r+l(r,4)-l(r,100)+l(r,400)+l(367*t-362,12)+Math.floor(t<=2?0:this.isLeapYear(e)?-1:-2)+a}},{key:"abs2greg",value: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),a=l(12*(e-this.toFixed(t,1,1)+(e<this.toFixed(t,3,1)?0:this.isLeapYear(t)?1:2))+373,367),r=e-this.toFixed(t,a,1)+1,n=new Date(t,a-1,r);return t<100&&t>=0&&n.setFullYear(t),n}}]),e}();i(y,"monthNames",["","January","February","March","April","May","June","July","August","September","October","November","December"]);var f={headers:{"plural-forms":"nplurals=2; plural=(n!=1);"},contexts:{"":{}}},v={h:"he",a:"ashkenazi",s:"en","":"en"},d=function(){function e(){o(this,e)}return u(e,null,[{key:"lookupTranslation",value:function(e,t){var a=t&&t.toLowerCase(),r=("string"==typeof t&&this.locales[a]||this.activeLocale)[e];if(r&&r.length&&r[0].length)return r[0]}},{key:"gettext",value:function(e,t){var a=this.lookupTranslation(e,t);return void 0===a?e:a}},{key:"addLocale",value:function(e,t){if("object"!==n(t.contexts)||"object"!==n(t.contexts[""]))throw new TypeError("Locale '".concat(e,"' invalid compact format"));this.locales[e.toLowerCase()]=t.contexts[""]}},{key:"useLocale",value:function(e){var t=e.toLowerCase(),a=this.locales[t];if(!a)throw new RangeError("Locale '".concat(e,"' not found"));return this.activeName=v[t]||t,this.activeLocale=a,this.activeLocale}},{key:"getLocaleName",value:function(){return this.activeName}},{key:"getLocaleNames",value:function(){return Object.keys(this.locales).sort()}},{key:"ordinal",value:function(e,t){var a=t&&t.toLowerCase()||this.activeName;if(!a)return this.getEnOrdinal(e);switch(a){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+"."}}},{key:"getEnOrdinal",value:function(e){var t=["th","st","nd","rd"],a=e%100;return e+(t[(a-20)%10]||t[a]||t[0])}},{key:"hebrewStripNikkud",value:function(e){return e.replace(/[\u0590-\u05bd]/g,"").replace(/[\u05bf-\u05c7]/g,"")}}]),e}();i(d,"locales",Object.create(null)),i(d,"activeLocale",null),i(d,"activeName",null),d.addLocale("en",f),d.addLocale("s",f),d.addLocale("",f),d.useLocale("en");var m={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},g=["","Nisan","Iyyar","Sivan","Tamuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Sh'vat"],b=[g.concat(["Adar","Nisan"]),g.concat(["Adar I","Adar II","Nisan"])];function p(e){throw new TypeError(e)}var k=Object.create(null),w=-1373428,D="day",M="week",Y="month",I="year",L={d:D,w:M,M:Y,y:I},N={day:D,week:M,month:Y,year:I},A=function(){function e(t,a,r){if(o(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=+r,isNaN(this.year))throw new TypeError("HDate called with bad year argument: ".concat(r));if(this.setMonth(a),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 n="number"!=typeof t||isNaN(t)?y.isDate(t)?y.greg2abs(t):e.isHDate(t)?{dd:t.day,mm:t.month,yy:t.year}:p("HDate called with bad argument: ".concat(t)):t,s="number"==typeof n,u=s?e.abs2hebrew(n):n;this.day=u.dd,this.month=u.mm,this.year=u.yy,s&&(this.abs0=n)}}return u(e,[{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 c(this.abs(),7)}},{key:"setFullYear",value:function(e){return this.year=e,T(this),this}},{key:"setMonth",value:function(t){return this.month=e.monthNum(t),T(this),this}},{key:"setDate",value:function(e){return this.day=e,T(this),this}},{key:"greg",value:function(){return y.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,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t||d.getLocaleName(),n=this.getDate(),o=d.gettext(this.getMonthName(),r),s=d.ordinal(n,r),u=e.getDayOfTranslation(r),i="".concat(s).concat(u," ").concat(o);if(a){var h=this.getFullYear();return"".concat(i,", ").concat(h)}return i}},{key:"renderGematriya",value:function(){var e=this.getDate(),t=d.gettext(this.getMonthName(),"he"),a=this.getFullYear();return r(e)+" "+t+" "+r(a)}},{key:"before",value:function(e){return F(e,this,-1)}},{key:"onOrBefore",value:function(e){return F(e,this,0)}},{key:"nearest",value:function(e){return F(e,this,3)}},{key:"onOrAfter",value:function(e){return F(e,this,6)}},{key:"after",value:function(e){return F(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 a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"d";if(!(t=parseInt(t,10)))return new e(this);if((a=e.standardizeUnits(a))===D)return new e(this.abs()+t);if(a===M)return new e(this.abs()+7*t);if(a===I)return new e(this.getDate(),this.getMonth(),this.getFullYear()+t);if(a===Y){var r=new e(this),n=t>0?1:-1;t=Math.abs(t);for(var o=0;o<t;o++)r=new e(r.abs()+n*r.daysInMonth());return r}}},{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(),a=this.getMonthName();return"".concat(e," ").concat(a," ").concat(t)}}],[{key:"hebrew2abs",value:function(t,a,r){var n=r;if(a<7){for(var o=7;o<=e.monthsInYear(t);o++)n+=e.daysInMonth(o,t);for(var s=1;s<a;s++)n+=e.daysInMonth(s,t)}else for(var u=7;u<a;u++)n+=e.daysInMonth(u,t);return w+e.elapsedDays(t)+n-1}},{key:"newYear",value:function(t){return w+e.elapsedDays(t)+e.newYearDelay(t)}},{key:"newYearDelay",value:function(t){var a=e.elapsedDays(t);return e.elapsedDays(t+1)-a==356?2:a-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 a=Math.floor((t-w)/365.24682220597794);e.newYear(a)<=t;)++a;--a;for(var r=t<e.hebrew2abs(a,1,1)?7:1;t>e.hebrew2abs(a,r,e.daysInMonth(r,a));)++r;return{yy:a,mm:r,dd:1+t-e.hebrew2abs(a,r,1)}}},{key:"getDayOfTranslation",value:function(e){switch(e){case"en":case"s":case"a":case"ashkenazi":return" of"}var t=d.lookupTranslation("of",e);return t?" "+t:"ashkenazi"===e.substring(0,9)?" of":""}},{key:"standardizeUnits",value:function(e){var t=L[e]||String(e||"").toLowerCase().replace(/s$/,"");return N[t]||p("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,a){return 2==t||4==t||6==t||10==t||13==t||12==t&&!e.isLeapYear(a)||8==t&&!e.longCheshvan(a)||9==t&&e.shortKislev(a)?29:30}},{key:"getMonthName",value:function(t,a){if("number"!=typeof t||t<1||t>14)throw new TypeError("bad month argument ".concat(t));return b[+e.isLeapYear(a)][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 k[t]=k[t]||e.elapsedDays0(t)}},{key:"elapsedDays0",value:function(t){var a=t-1,r=235*Math.floor(a/19)+a%19*12+Math.floor((a%19*7+1)/19),n=204+r%1080*793,o=5+12*r+793*Math.floor(r/1080)+Math.floor(n/1080),s=n%1080+o%24*1080,u=1+29*r+Math.floor(o/24),i=u+(s>=19440||2==u%7&&s>=9924&&!e.isLeapYear(t)||1==u%7&&s>=16789&&e.isLeapYear(a));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"===n(e)&&"number"==typeof e.year&&"number"==typeof e.month&&"number"==typeof e.day&&"function"==typeof e.greg&&"function"==typeof e.abs}}]),e}();function T(e){E(e),function(e){e.day<1&&(7==e.month&&(e.year-=1),e.day+=A.daysInMonth(e.month,e.year),e.month-=1,T(e));e.day>A.daysInMonth(e.month,e.year)&&(6==e.month&&(e.year+=1),e.day-=A.daysInMonth(e.month,e.year),e.month+=1,T(e));E(e)}(e)}function E(e){13!=e.month||e.isLeapYear()?e.month<1?(e.month+=A.monthsInYear(e.year),e.year-=1,T(e)):e.month>A.monthsInYear(e.year)&&(e.month-=A.monthsInYear(e.year),e.year+=1,T(e)):(e.month-=1,T(e)),delete e.abs0}function F(e,t,a){return new A(A.dayOnOrBefore(e,t.abs()+a))}var S=m.NISAN,O=m.CHESHVAN,C=m.KISLEV,H=m.TEVET,x=m.SHVAT,_=m.ADAR_I,z=m.ADAR_II;var j={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 d.addLocale("he",j),d.addLocale("h",j),e.HDate=A,e.Locale=d,e.gematriya=r,e.getBirthdayOrAnniversary=function(e,t){var a=A.isHDate(t)?t:new A(t),r=a.getFullYear();if(!(e<=r)){var n=A.isLeapYear(r),o=a.getMonth(),s=a.getDate();return o==_&&!n||o==z&&n?o=A.monthsInYear(e):o!=O||30!=s||A.longCheshvan(e)?o==C&&30==s&&A.shortKislev(e)?(o=H,s=1):o==_&&30==s&&n&&!A.isLeapYear(e)&&(o=S,s=1):(o=C,s=1),new A(s,o,e)}},e.getYahrzeit=function(e,t){var a=A.isHDate(t)?t:new A(t),r={yy:a.getFullYear(),mm:a.getMonth(),dd:a.getDate()};if(!(e<=r.yy))return r.mm!=O||30!=r.dd||A.longCheshvan(r.yy+1)?r.mm==C&&30==r.dd&&A.shortKislev(r.yy+1)?r=A.abs2hebrew(A.hebrew2abs(e,H,1)-1):r.mm==z?r.mm=A.monthsInYear(e):r.mm!=_||30!=r.dd||A.isLeapYear(e)||(r.dd=30,r.mm=x):r=A.abs2hebrew(A.hebrew2abs(e,C,1)-1),r.mm!=O||30!=r.dd||A.longCheshvan(e)?r.mm==C&&30==r.dd&&A.shortKislev(e)&&(r.mm=H,r.dd=1):(r.mm=C,r.dd=1),new A(r.dd,r.mm,e)},e.greg=y,e.months=m,e.version="3.36.2",Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
|
1
|
+
/*! @hebcal/core v3.37.0 */
|
|
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 a(e){for(var t=[];e>0;){if(15===e||16===e){t.push(9),t.push(e-9);break}var a=100,r=void 0;for(r=400;r>e;r-=a)r===a&&(a/=10);t.push(r),e-=r}return t}function r(e){var r=parseInt(e,10);if(!r)throw new TypeError("invalid parameter to gematriya ".concat(e));var n="",o=Math.floor(r/1e3);if(o>0&&5!==o){for(var s=a(o),u=0;u<s.length;u++)n+=t(s[u]);n+="׳"}var i=a(r%1e3);if(1==i.length)return n+t(i[0])+"׳";for(var h=0;h<i.length;h++)h+1===i.length&&(n+="״"),n+=t(i[h]);return n}function n(e){return n="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},n(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,a){return t&&s(e.prototype,t),a&&s(e,a),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var h=[[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 c(e,t){return e-t*Math.floor(e/t)}function l(e,t){return Math.floor(e/t)}var y=function(){function e(){o(this,e)}return u(e,null,[{key:"isLeapYear",value:function(e){return!(e%4||!(e%100)&&e%400)}},{key:"daysInMonth",value:function(e,t){return h[+this.isLeapYear(t)][e]}},{key:"isDate",value:function(e){return"object"===n(e)&&Date.prototype===e.__proto__}},{key:"dayOfYear",value: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}},{key:"greg2abs",value: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))}},{key:"yearFromFixed",value:function(e){var t=e-1,a=l(t,146097),r=c(t,146097),n=l(r,36524),o=c(r,36524),s=l(o,1461),u=l(c(o,1461),365),i=400*a+100*n+4*s+u;return 4!=n&&4!=u?i+1:i}},{key:"toFixed",value:function(e,t,a){var r=e-1;return 0+365*r+l(r,4)-l(r,100)+l(r,400)+l(367*t-362,12)+Math.floor(t<=2?0:this.isLeapYear(e)?-1:-2)+a}},{key:"abs2greg",value: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),a=l(12*(e-this.toFixed(t,1,1)+(e<this.toFixed(t,3,1)?0:this.isLeapYear(t)?1:2))+373,367),r=e-this.toFixed(t,a,1)+1,n=new Date(t,a-1,r);return t<100&&t>=0&&n.setFullYear(t),n}}]),e}();i(y,"monthNames",["","January","February","March","April","May","June","July","August","September","October","November","December"]);var f={headers:{"plural-forms":"nplurals=2; plural=(n!=1);"},contexts:{"":{}}},v={h:"he",a:"ashkenazi",s:"en","":"en"},d=function(){function e(){o(this,e)}return u(e,null,[{key:"lookupTranslation",value:function(e,t){var a=t&&t.toLowerCase(),r=("string"==typeof t&&this.locales[a]||this.activeLocale)[e];if(r&&r.length&&r[0].length)return r[0]}},{key:"gettext",value:function(e,t){var a=this.lookupTranslation(e,t);return void 0===a?e:a}},{key:"addLocale",value:function(e,t){if("object"!==n(t.contexts)||"object"!==n(t.contexts[""]))throw new TypeError("Locale '".concat(e,"' invalid compact format"));this.locales[e.toLowerCase()]=t.contexts[""]}},{key:"useLocale",value:function(e){var t=e.toLowerCase(),a=this.locales[t];if(!a)throw new RangeError("Locale '".concat(e,"' not found"));return this.activeName=v[t]||t,this.activeLocale=a,this.activeLocale}},{key:"getLocaleName",value:function(){return this.activeName}},{key:"getLocaleNames",value:function(){return Object.keys(this.locales).sort()}},{key:"ordinal",value:function(e,t){var a=t&&t.toLowerCase()||this.activeName;if(!a)return this.getEnOrdinal(e);switch(a){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+"."}}},{key:"getEnOrdinal",value:function(e){var t=["th","st","nd","rd"],a=e%100;return e+(t[(a-20)%10]||t[a]||t[0])}},{key:"hebrewStripNikkud",value:function(e){return e.replace(/[\u0590-\u05bd]/g,"").replace(/[\u05bf-\u05c7]/g,"")}}]),e}();i(d,"locales",Object.create(null)),i(d,"activeLocale",null),i(d,"activeName",null),d.addLocale("en",f),d.addLocale("s",f),d.addLocale("",f),d.useLocale("en");var m={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},g=["","Nisan","Iyyar","Sivan","Tamuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Sh'vat"],b=[g.concat(["Adar","Nisan"]),g.concat(["Adar I","Adar II","Nisan"])];function p(e){throw new TypeError(e)}var k=Object.create(null),w=-1373428,D="day",M="week",Y="month",I="year",L={d:D,w:M,M:Y,y:I},N={day:D,week:M,month:Y,year:I},A=function(){function e(t,a,r){if(o(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=+r,isNaN(this.year))throw new TypeError("HDate called with bad year argument: ".concat(r));if(this.setMonth(a),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 n="number"!=typeof t||isNaN(t)?y.isDate(t)?y.greg2abs(t):e.isHDate(t)?{dd:t.day,mm:t.month,yy:t.year}:p("HDate called with bad argument: ".concat(t)):t,s="number"==typeof n,u=s?e.abs2hebrew(n):n;this.day=u.dd,this.month=u.mm,this.year=u.yy,s&&(this.abs0=n)}}return u(e,[{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 c(this.abs(),7)}},{key:"setFullYear",value:function(e){return this.year=e,T(this),this}},{key:"setMonth",value:function(t){return this.month=e.monthNum(t),T(this),this}},{key:"setDate",value:function(e){return this.day=e,T(this),this}},{key:"greg",value:function(){return y.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,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t||d.getLocaleName(),n=this.getDate(),o=d.gettext(this.getMonthName(),r),s=d.ordinal(n,r),u=e.getDayOfTranslation(r),i="".concat(s).concat(u," ").concat(o);if(a){var h=this.getFullYear();return"".concat(i,", ").concat(h)}return i}},{key:"renderGematriya",value:function(){var e=this.getDate(),t=d.gettext(this.getMonthName(),"he"),a=this.getFullYear();return r(e)+" "+t+" "+r(a)}},{key:"before",value:function(e){return F(e,this,-1)}},{key:"onOrBefore",value:function(e){return F(e,this,0)}},{key:"nearest",value:function(e){return F(e,this,3)}},{key:"onOrAfter",value:function(e){return F(e,this,6)}},{key:"after",value:function(e){return F(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 a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"d";if(!(t=parseInt(t,10)))return new e(this);if((a=e.standardizeUnits(a))===D)return new e(this.abs()+t);if(a===M)return new e(this.abs()+7*t);if(a===I)return new e(this.getDate(),this.getMonth(),this.getFullYear()+t);if(a===Y){var r=new e(this),n=t>0?1:-1;t=Math.abs(t);for(var o=0;o<t;o++)r=new e(r.abs()+n*r.daysInMonth());return r}}},{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(),a=this.getMonthName();return"".concat(e," ").concat(a," ").concat(t)}}],[{key:"hebrew2abs",value:function(t,a,r){var n=r;if(a<7){for(var o=7;o<=e.monthsInYear(t);o++)n+=e.daysInMonth(o,t);for(var s=1;s<a;s++)n+=e.daysInMonth(s,t)}else for(var u=7;u<a;u++)n+=e.daysInMonth(u,t);return w+e.elapsedDays(t)+n-1}},{key:"newYear",value:function(t){return w+e.elapsedDays(t)+e.newYearDelay(t)}},{key:"newYearDelay",value:function(t){var a=e.elapsedDays(t);return e.elapsedDays(t+1)-a==356?2:a-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 a=Math.floor((t-w)/365.24682220597794);e.newYear(a)<=t;)++a;--a;for(var r=t<e.hebrew2abs(a,1,1)?7:1;t>e.hebrew2abs(a,r,e.daysInMonth(r,a));)++r;return{yy:a,mm:r,dd:1+t-e.hebrew2abs(a,r,1)}}},{key:"getDayOfTranslation",value:function(e){switch(e){case"en":case"s":case"a":case"ashkenazi":return" of"}var t=d.lookupTranslation("of",e);return t?" "+t:"ashkenazi"===e.substring(0,9)?" of":""}},{key:"standardizeUnits",value:function(e){var t=L[e]||String(e||"").toLowerCase().replace(/s$/,"");return N[t]||p("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,a){return 2==t||4==t||6==t||10==t||13==t||12==t&&!e.isLeapYear(a)||8==t&&!e.longCheshvan(a)||9==t&&e.shortKislev(a)?29:30}},{key:"getMonthName",value:function(t,a){if("number"!=typeof t||t<1||t>14)throw new TypeError("bad month argument ".concat(t));return b[+e.isLeapYear(a)][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 k[t]=k[t]||e.elapsedDays0(t)}},{key:"elapsedDays0",value:function(t){var a=t-1,r=235*Math.floor(a/19)+a%19*12+Math.floor((a%19*7+1)/19),n=204+r%1080*793,o=5+12*r+793*Math.floor(r/1080)+Math.floor(n/1080),s=n%1080+o%24*1080,u=1+29*r+Math.floor(o/24),i=u+(s>=19440||2==u%7&&s>=9924&&!e.isLeapYear(t)||1==u%7&&s>=16789&&e.isLeapYear(a));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"===n(e)&&"number"==typeof e.year&&"number"==typeof e.month&&"number"==typeof e.day&&"function"==typeof e.greg&&"function"==typeof e.abs}}]),e}();function T(e){E(e),function(e){e.day<1&&(7==e.month&&(e.year-=1),e.day+=A.daysInMonth(e.month,e.year),e.month-=1,T(e));e.day>A.daysInMonth(e.month,e.year)&&(6==e.month&&(e.year+=1),e.day-=A.daysInMonth(e.month,e.year),e.month+=1,T(e));E(e)}(e)}function E(e){13!=e.month||e.isLeapYear()?e.month<1?(e.month+=A.monthsInYear(e.year),e.year-=1,T(e)):e.month>A.monthsInYear(e.year)&&(e.month-=A.monthsInYear(e.year),e.year+=1,T(e)):(e.month-=1,T(e)),delete e.abs0}function F(e,t,a){return new A(A.dayOnOrBefore(e,t.abs()+a))}var S=m.NISAN,O=m.CHESHVAN,C=m.KISLEV,H=m.TEVET,x=m.SHVAT,_=m.ADAR_I,z=m.ADAR_II;var j={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 d.addLocale("he",j),d.addLocale("h",j),e.HDate=A,e.Locale=d,e.gematriya=r,e.getBirthdayOrAnniversary=function(e,t){var a=A.isHDate(t)?t:new A(t),r=a.getFullYear();if(!(e<=r)){var n=A.isLeapYear(r),o=a.getMonth(),s=a.getDate();return o==_&&!n||o==z&&n?o=A.monthsInYear(e):o!=O||30!=s||A.longCheshvan(e)?o==C&&30==s&&A.shortKislev(e)?(o=H,s=1):o==_&&30==s&&n&&!A.isLeapYear(e)&&(o=S,s=1):(o=C,s=1),new A(s,o,e)}},e.getYahrzeit=function(e,t){var a=A.isHDate(t)?t:new A(t),r={yy:a.getFullYear(),mm:a.getMonth(),dd:a.getDate()};if(!(e<=r.yy))return r.mm!=O||30!=r.dd||A.longCheshvan(r.yy+1)?r.mm==C&&30==r.dd&&A.shortKislev(r.yy+1)?r=A.abs2hebrew(A.hebrew2abs(e,H,1)-1):r.mm==z?r.mm=A.monthsInYear(e):r.mm!=_||30!=r.dd||A.isLeapYear(e)||(r.dd=30,r.mm=x):r=A.abs2hebrew(A.hebrew2abs(e,C,1)-1),r.mm!=O||30!=r.dd||A.longCheshvan(e)?r.mm==C&&30==r.dd&&A.shortKislev(e)&&(r.mm=H,r.dd=1):(r.mm=C,r.dd=1),new A(r.dd,r.mm,e)},e.greg=y,e.months=m,e.version="3.37.0",Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
package/dist/hdate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v3.
|
|
1
|
+
/*! @hebcal/core v3.37.0 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -1761,7 +1761,7 @@ function getBirthdayOrAnniversary_(hyear, gdate) {
|
|
|
1761
1761
|
return new HDate(day, month, hyear);
|
|
1762
1762
|
}
|
|
1763
1763
|
|
|
1764
|
-
const version="3.
|
|
1764
|
+
const version="3.37.0";
|
|
1765
1765
|
|
|
1766
1766
|
const headers={"plural-forms":"nplurals=2; plural=(n > 1);",language:"he"};const contexts={"":{Adar:["אַדָר"],"Adar I":["אַדָר א׳"],"Adar II":["אַדָר ב׳"],Av:["אָב"],Cheshvan:["חֶשְׁוָן"],Elul:["אֱלוּל"],Iyyar:["אִיָיר"],Kislev:["כִּסְלֵו"],Nisan:["נִיסָן"],"Sh'vat":["שְׁבָט"],Sivan:["סִיוָן"],Tamuz:["תַּמּוּז"],Tevet:["טֵבֵת"],Tishrei:["תִשְׁרֵי"]}};var poHeMin = {headers:headers,contexts:contexts};
|
|
1767
1767
|
|
package/dist/hdate.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v3.
|
|
1
|
+
/*! @hebcal/core v3.37.0 */
|
|
2
2
|
const GERESH = '׳';
|
|
3
3
|
const GERSHAYIM = '״';
|
|
4
4
|
/**
|
|
@@ -1757,7 +1757,7 @@ function getBirthdayOrAnniversary_(hyear, gdate) {
|
|
|
1757
1757
|
return new HDate(day, month, hyear);
|
|
1758
1758
|
}
|
|
1759
1759
|
|
|
1760
|
-
const version="3.
|
|
1760
|
+
const version="3.37.0";
|
|
1761
1761
|
|
|
1762
1762
|
const headers={"plural-forms":"nplurals=2; plural=(n > 1);",language:"he"};const contexts={"":{Adar:["אַדָר"],"Adar I":["אַדָר א׳"],"Adar II":["אַדָר ב׳"],Av:["אָב"],Cheshvan:["חֶשְׁוָן"],Elul:["אֱלוּל"],Iyyar:["אִיָיר"],Kislev:["כִּסְלֵו"],Nisan:["נִיסָן"],"Sh'vat":["שְׁבָט"],Sivan:["סִיוָן"],Tamuz:["תַּמּוּז"],Tevet:["טֵבֵת"],Tishrei:["תִשְׁרֵי"]}};var poHeMin = {headers:headers,contexts:contexts};
|
|
1763
1763
|
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v3.
|
|
1
|
+
/*! @hebcal/core v3.37.0 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -3723,6 +3723,10 @@ class OmerEvent extends Event {
|
|
|
3723
3723
|
|
|
3724
3724
|
|
|
3725
3725
|
getTodayIs(locale) {
|
|
3726
|
+
if (locale === 'he' || locale === 'he') {
|
|
3727
|
+
return getTodayIsHe(this.omer);
|
|
3728
|
+
}
|
|
3729
|
+
|
|
3726
3730
|
const totalDaysStr = this.omer === 1 ? 'day' : 'days';
|
|
3727
3731
|
let str = `Today is ${this.omer} ${totalDaysStr}`;
|
|
3728
3732
|
|
|
@@ -3747,13 +3751,94 @@ class OmerEvent extends Event {
|
|
|
3747
3751
|
return `https://www.hebcal.com/omer/${this.getDate().getFullYear()}/${this.omer}`;
|
|
3748
3752
|
}
|
|
3749
3753
|
|
|
3754
|
+
} // adapted from pip hdate package (GPL)
|
|
3755
|
+
// https://github.com/py-libhdate/py-libhdate/blob/master/hdate/date.py
|
|
3756
|
+
|
|
3757
|
+
const tens = ['', 'עֲשָׂרָה', 'עֶשְׂרִים', 'שְׁלוֹשִׁים', 'אַרְבָּעִים'];
|
|
3758
|
+
const ones = ['', 'אֶחָד', 'שְׁנַיִם', 'שְׁלוֹשָׁה', 'אַרְבָּעָה', 'חֲמִשָׁה', 'שִׁשָׁה', 'שִׁבְעָה', 'שְׁמוֹנָה', 'תִּשְׁעָה'];
|
|
3759
|
+
const shnei = 'שְׁנֵי';
|
|
3760
|
+
const yamim = 'יָמִים';
|
|
3761
|
+
const shneiYamim = shnei + ' ' + yamim;
|
|
3762
|
+
const shavuot = 'שָׁבוּעוֹת';
|
|
3763
|
+
const yom = 'יוֹם';
|
|
3764
|
+
const yomEchad = yom + ' ' + ones[1];
|
|
3765
|
+
/**
|
|
3766
|
+
* @private
|
|
3767
|
+
* @param {number} omer
|
|
3768
|
+
* @return {string}
|
|
3769
|
+
*/
|
|
3770
|
+
|
|
3771
|
+
function getTodayIsHe(omer) {
|
|
3772
|
+
const ten = Math.floor(omer / 10);
|
|
3773
|
+
const one = omer % 10;
|
|
3774
|
+
let str = 'הַיוֹם ';
|
|
3775
|
+
|
|
3776
|
+
if (10 < omer && omer < 20) {
|
|
3777
|
+
str += ones[one] + ' עָשָׂר';
|
|
3778
|
+
} else if (omer > 9) {
|
|
3779
|
+
str += ones[one];
|
|
3780
|
+
|
|
3781
|
+
if (one) {
|
|
3782
|
+
str += ' וְ';
|
|
3783
|
+
}
|
|
3784
|
+
}
|
|
3785
|
+
|
|
3786
|
+
if (omer > 2) {
|
|
3787
|
+
if (omer > 20 || omer === 10 || omer === 20) {
|
|
3788
|
+
str += tens[ten];
|
|
3789
|
+
}
|
|
3790
|
+
|
|
3791
|
+
if (omer < 11) {
|
|
3792
|
+
str += ones[one] + ' ' + yamim + ' ';
|
|
3793
|
+
} else {
|
|
3794
|
+
str += ' ' + yom + ' ';
|
|
3795
|
+
}
|
|
3796
|
+
} else if (omer === 1) {
|
|
3797
|
+
str += yomEchad + ' ';
|
|
3798
|
+
} else {
|
|
3799
|
+
// omer == 2
|
|
3800
|
+
str += shneiYamim + ' ';
|
|
3801
|
+
}
|
|
3802
|
+
|
|
3803
|
+
if (omer > 6) {
|
|
3804
|
+
str = str.trim(); // remove trailing space before comma
|
|
3805
|
+
|
|
3806
|
+
str += ', שְׁהֵם ';
|
|
3807
|
+
const weeks = Math.floor(omer / 7);
|
|
3808
|
+
const days = omer % 7;
|
|
3809
|
+
|
|
3810
|
+
if (weeks > 2) {
|
|
3811
|
+
str += ones[weeks] + ' ' + shavuot + ' ';
|
|
3812
|
+
} else if (weeks == 1) {
|
|
3813
|
+
str += 'שָׁבוּעַ' + ' ' + ones[1] + ' ';
|
|
3814
|
+
} else {
|
|
3815
|
+
// weeks == 2
|
|
3816
|
+
str += shnei + ' ' + shavuot + ' ';
|
|
3817
|
+
}
|
|
3818
|
+
|
|
3819
|
+
if (days) {
|
|
3820
|
+
str += 'וְ';
|
|
3821
|
+
|
|
3822
|
+
if (days > 2) {
|
|
3823
|
+
str += ones[days] + ' ' + yamim + ' ';
|
|
3824
|
+
} else if (days == 1) {
|
|
3825
|
+
str += yomEchad + ' ';
|
|
3826
|
+
} else {
|
|
3827
|
+
// days == 2
|
|
3828
|
+
str += shneiYamim + ' ';
|
|
3829
|
+
}
|
|
3830
|
+
}
|
|
3831
|
+
}
|
|
3832
|
+
|
|
3833
|
+
str += 'לָעוֹמֶר';
|
|
3834
|
+
return str;
|
|
3750
3835
|
}
|
|
3751
3836
|
|
|
3752
3837
|
/* eslint-disable no-multi-spaces */
|
|
3753
3838
|
const osdate = new Date(1923, 8, 11);
|
|
3754
3839
|
const osday = greg.greg2abs(osdate);
|
|
3755
3840
|
const nsday = greg.greg2abs(new Date(1975, 5, 24));
|
|
3756
|
-
const shas = [['Berachot', 64], ['Shabbat', 157], ['Eruvin', 105], ['Pesachim', 121], ['Shekalim', 22], ['Yoma', 88], ['Sukkah', 56], ['Beitzah', 40], ['Rosh Hashana', 35], ['Taanit', 31], ['Megillah', 32], ['Moed Katan', 29], ['Chagigah', 27], ['Yevamot', 122], ['Ketubot', 112], ['Nedarim', 91], ['Nazir', 66], ['Sotah', 49], ['Gitin', 90], ['Kiddushin', 82], ['Baba Kamma', 119], ['Baba Metzia', 119], ['Baba Batra', 176], ['Sanhedrin', 113], ['Makkot', 24], ['Shevuot', 49], ['Avodah Zarah', 76], ['Horayot', 14], ['Zevachim', 120], ['Menachot', 110], ['Chullin', 142], ['Bechorot', 61], ['Arachin', 34], ['Temurah', 34], ['Keritot', 28], ['Meilah', 22], ['Kinnim', 4], ['Tamid',
|
|
3841
|
+
const shas = [['Berachot', 64], ['Shabbat', 157], ['Eruvin', 105], ['Pesachim', 121], ['Shekalim', 22], ['Yoma', 88], ['Sukkah', 56], ['Beitzah', 40], ['Rosh Hashana', 35], ['Taanit', 31], ['Megillah', 32], ['Moed Katan', 29], ['Chagigah', 27], ['Yevamot', 122], ['Ketubot', 112], ['Nedarim', 91], ['Nazir', 66], ['Sotah', 49], ['Gitin', 90], ['Kiddushin', 82], ['Baba Kamma', 119], ['Baba Metzia', 119], ['Baba Batra', 176], ['Sanhedrin', 113], ['Makkot', 24], ['Shevuot', 49], ['Avodah Zarah', 76], ['Horayot', 14], ['Zevachim', 120], ['Menachot', 110], ['Chullin', 142], ['Bechorot', 61], ['Arachin', 34], ['Temurah', 34], ['Keritot', 28], ['Meilah', 22], ['Kinnim', 4], ['Tamid', 9], ['Midot', 5], ['Niddah', 73]].map(m => {
|
|
3757
3842
|
return {
|
|
3758
3843
|
name: m[0],
|
|
3759
3844
|
blatt: m[1]
|
|
@@ -3825,7 +3910,7 @@ class DafYomi {
|
|
|
3825
3910
|
break;
|
|
3826
3911
|
|
|
3827
3912
|
case 38:
|
|
3828
|
-
blatt = blatt +
|
|
3913
|
+
blatt = blatt + 32;
|
|
3829
3914
|
break;
|
|
3830
3915
|
} // Bailout
|
|
3831
3916
|
|
|
@@ -5278,7 +5363,7 @@ function getBirthdayOrAnniversary_(hyear, gdate) {
|
|
|
5278
5363
|
return new HDate(day, month, hyear);
|
|
5279
5364
|
}
|
|
5280
5365
|
|
|
5281
|
-
var version="3.
|
|
5366
|
+
var version="3.37.0";
|
|
5282
5367
|
|
|
5283
5368
|
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"],Berakhot:["Berakhos"],Sheviit:["Sheviis"],Terumot:["Terumos"],Maasrot:["Maasros"],Eduyot:["Eduyos"],Avot:["Avos"],Bekhorot:["Bekhoros"],Middot:["Middos"],Oholot:["Oholos"],Tahorot:["Tahoros"],Mikvaot:["Mikvaos"]}};var poAshkenazi = {headers:headers$1,contexts:contexts$1};
|
|
5284
5369
|
|
|
@@ -5900,7 +5985,11 @@ class HebrewCalendar {
|
|
|
5900
5985
|
|
|
5901
5986
|
if (options.candlelighting) {
|
|
5902
5987
|
const zmanim = new Zmanim(hd.prev(), location.getLatitude(), location.getLongitude());
|
|
5903
|
-
|
|
5988
|
+
const tzeit = zmanim.tzeit(7.0833);
|
|
5989
|
+
|
|
5990
|
+
if (!isNaN(tzeit.getTime())) {
|
|
5991
|
+
omerEv.alarm = tzeit;
|
|
5992
|
+
}
|
|
5904
5993
|
}
|
|
5905
5994
|
|
|
5906
5995
|
evts.push(omerEv);
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v3.
|
|
1
|
+
/*! @hebcal/core v3.37.0 */
|
|
2
2
|
/*
|
|
3
3
|
Hebcal - A Jewish Calendar Generator
|
|
4
4
|
Copyright (c) 1994-2020 Danny Sadinoff
|
|
@@ -3699,6 +3699,10 @@ class OmerEvent extends Event {
|
|
|
3699
3699
|
|
|
3700
3700
|
|
|
3701
3701
|
getTodayIs(locale) {
|
|
3702
|
+
if (locale === 'he' || locale === 'he') {
|
|
3703
|
+
return getTodayIsHe(this.omer);
|
|
3704
|
+
}
|
|
3705
|
+
|
|
3702
3706
|
const totalDaysStr = this.omer === 1 ? 'day' : 'days';
|
|
3703
3707
|
let str = `Today is ${this.omer} ${totalDaysStr}`;
|
|
3704
3708
|
|
|
@@ -3723,13 +3727,94 @@ class OmerEvent extends Event {
|
|
|
3723
3727
|
return `https://www.hebcal.com/omer/${this.getDate().getFullYear()}/${this.omer}`;
|
|
3724
3728
|
}
|
|
3725
3729
|
|
|
3730
|
+
} // adapted from pip hdate package (GPL)
|
|
3731
|
+
// https://github.com/py-libhdate/py-libhdate/blob/master/hdate/date.py
|
|
3732
|
+
|
|
3733
|
+
const tens = ['', 'עֲשָׂרָה', 'עֶשְׂרִים', 'שְׁלוֹשִׁים', 'אַרְבָּעִים'];
|
|
3734
|
+
const ones = ['', 'אֶחָד', 'שְׁנַיִם', 'שְׁלוֹשָׁה', 'אַרְבָּעָה', 'חֲמִשָׁה', 'שִׁשָׁה', 'שִׁבְעָה', 'שְׁמוֹנָה', 'תִּשְׁעָה'];
|
|
3735
|
+
const shnei = 'שְׁנֵי';
|
|
3736
|
+
const yamim = 'יָמִים';
|
|
3737
|
+
const shneiYamim = shnei + ' ' + yamim;
|
|
3738
|
+
const shavuot = 'שָׁבוּעוֹת';
|
|
3739
|
+
const yom = 'יוֹם';
|
|
3740
|
+
const yomEchad = yom + ' ' + ones[1];
|
|
3741
|
+
/**
|
|
3742
|
+
* @private
|
|
3743
|
+
* @param {number} omer
|
|
3744
|
+
* @return {string}
|
|
3745
|
+
*/
|
|
3746
|
+
|
|
3747
|
+
function getTodayIsHe(omer) {
|
|
3748
|
+
const ten = Math.floor(omer / 10);
|
|
3749
|
+
const one = omer % 10;
|
|
3750
|
+
let str = 'הַיוֹם ';
|
|
3751
|
+
|
|
3752
|
+
if (10 < omer && omer < 20) {
|
|
3753
|
+
str += ones[one] + ' עָשָׂר';
|
|
3754
|
+
} else if (omer > 9) {
|
|
3755
|
+
str += ones[one];
|
|
3756
|
+
|
|
3757
|
+
if (one) {
|
|
3758
|
+
str += ' וְ';
|
|
3759
|
+
}
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
if (omer > 2) {
|
|
3763
|
+
if (omer > 20 || omer === 10 || omer === 20) {
|
|
3764
|
+
str += tens[ten];
|
|
3765
|
+
}
|
|
3766
|
+
|
|
3767
|
+
if (omer < 11) {
|
|
3768
|
+
str += ones[one] + ' ' + yamim + ' ';
|
|
3769
|
+
} else {
|
|
3770
|
+
str += ' ' + yom + ' ';
|
|
3771
|
+
}
|
|
3772
|
+
} else if (omer === 1) {
|
|
3773
|
+
str += yomEchad + ' ';
|
|
3774
|
+
} else {
|
|
3775
|
+
// omer == 2
|
|
3776
|
+
str += shneiYamim + ' ';
|
|
3777
|
+
}
|
|
3778
|
+
|
|
3779
|
+
if (omer > 6) {
|
|
3780
|
+
str = str.trim(); // remove trailing space before comma
|
|
3781
|
+
|
|
3782
|
+
str += ', שְׁהֵם ';
|
|
3783
|
+
const weeks = Math.floor(omer / 7);
|
|
3784
|
+
const days = omer % 7;
|
|
3785
|
+
|
|
3786
|
+
if (weeks > 2) {
|
|
3787
|
+
str += ones[weeks] + ' ' + shavuot + ' ';
|
|
3788
|
+
} else if (weeks == 1) {
|
|
3789
|
+
str += 'שָׁבוּעַ' + ' ' + ones[1] + ' ';
|
|
3790
|
+
} else {
|
|
3791
|
+
// weeks == 2
|
|
3792
|
+
str += shnei + ' ' + shavuot + ' ';
|
|
3793
|
+
}
|
|
3794
|
+
|
|
3795
|
+
if (days) {
|
|
3796
|
+
str += 'וְ';
|
|
3797
|
+
|
|
3798
|
+
if (days > 2) {
|
|
3799
|
+
str += ones[days] + ' ' + yamim + ' ';
|
|
3800
|
+
} else if (days == 1) {
|
|
3801
|
+
str += yomEchad + ' ';
|
|
3802
|
+
} else {
|
|
3803
|
+
// days == 2
|
|
3804
|
+
str += shneiYamim + ' ';
|
|
3805
|
+
}
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3808
|
+
|
|
3809
|
+
str += 'לָעוֹמֶר';
|
|
3810
|
+
return str;
|
|
3726
3811
|
}
|
|
3727
3812
|
|
|
3728
3813
|
/* eslint-disable no-multi-spaces */
|
|
3729
3814
|
const osdate = new Date(1923, 8, 11);
|
|
3730
3815
|
const osday = greg.greg2abs(osdate);
|
|
3731
3816
|
const nsday = greg.greg2abs(new Date(1975, 5, 24));
|
|
3732
|
-
const shas = [['Berachot', 64], ['Shabbat', 157], ['Eruvin', 105], ['Pesachim', 121], ['Shekalim', 22], ['Yoma', 88], ['Sukkah', 56], ['Beitzah', 40], ['Rosh Hashana', 35], ['Taanit', 31], ['Megillah', 32], ['Moed Katan', 29], ['Chagigah', 27], ['Yevamot', 122], ['Ketubot', 112], ['Nedarim', 91], ['Nazir', 66], ['Sotah', 49], ['Gitin', 90], ['Kiddushin', 82], ['Baba Kamma', 119], ['Baba Metzia', 119], ['Baba Batra', 176], ['Sanhedrin', 113], ['Makkot', 24], ['Shevuot', 49], ['Avodah Zarah', 76], ['Horayot', 14], ['Zevachim', 120], ['Menachot', 110], ['Chullin', 142], ['Bechorot', 61], ['Arachin', 34], ['Temurah', 34], ['Keritot', 28], ['Meilah', 22], ['Kinnim', 4], ['Tamid',
|
|
3817
|
+
const shas = [['Berachot', 64], ['Shabbat', 157], ['Eruvin', 105], ['Pesachim', 121], ['Shekalim', 22], ['Yoma', 88], ['Sukkah', 56], ['Beitzah', 40], ['Rosh Hashana', 35], ['Taanit', 31], ['Megillah', 32], ['Moed Katan', 29], ['Chagigah', 27], ['Yevamot', 122], ['Ketubot', 112], ['Nedarim', 91], ['Nazir', 66], ['Sotah', 49], ['Gitin', 90], ['Kiddushin', 82], ['Baba Kamma', 119], ['Baba Metzia', 119], ['Baba Batra', 176], ['Sanhedrin', 113], ['Makkot', 24], ['Shevuot', 49], ['Avodah Zarah', 76], ['Horayot', 14], ['Zevachim', 120], ['Menachot', 110], ['Chullin', 142], ['Bechorot', 61], ['Arachin', 34], ['Temurah', 34], ['Keritot', 28], ['Meilah', 22], ['Kinnim', 4], ['Tamid', 9], ['Midot', 5], ['Niddah', 73]].map(m => {
|
|
3733
3818
|
return {
|
|
3734
3819
|
name: m[0],
|
|
3735
3820
|
blatt: m[1]
|
|
@@ -3801,7 +3886,7 @@ class DafYomi {
|
|
|
3801
3886
|
break;
|
|
3802
3887
|
|
|
3803
3888
|
case 38:
|
|
3804
|
-
blatt = blatt +
|
|
3889
|
+
blatt = blatt + 32;
|
|
3805
3890
|
break;
|
|
3806
3891
|
} // Bailout
|
|
3807
3892
|
|
|
@@ -5254,7 +5339,7 @@ function getBirthdayOrAnniversary_(hyear, gdate) {
|
|
|
5254
5339
|
return new HDate(day, month, hyear);
|
|
5255
5340
|
}
|
|
5256
5341
|
|
|
5257
|
-
const version="3.
|
|
5342
|
+
const version="3.37.0";
|
|
5258
5343
|
|
|
5259
5344
|
const headers$1={"plural-forms":"nplurals=2; plural=(n > 1);",language:"en_CA@ashkenazi"};const 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"],Berakhot:["Berakhos"],Sheviit:["Sheviis"],Terumot:["Terumos"],Maasrot:["Maasros"],Eduyot:["Eduyos"],Avot:["Avos"],Bekhorot:["Bekhoros"],Middot:["Middos"],Oholot:["Oholos"],Tahorot:["Tahoros"],Mikvaot:["Mikvaos"]}};var poAshkenazi = {headers:headers$1,contexts:contexts$1};
|
|
5260
5345
|
|
|
@@ -5876,7 +5961,11 @@ class HebrewCalendar {
|
|
|
5876
5961
|
|
|
5877
5962
|
if (options.candlelighting) {
|
|
5878
5963
|
const zmanim = new Zmanim(hd.prev(), location.getLatitude(), location.getLongitude());
|
|
5879
|
-
|
|
5964
|
+
const tzeit = zmanim.tzeit(7.0833);
|
|
5965
|
+
|
|
5966
|
+
if (!isNaN(tzeit.getTime())) {
|
|
5967
|
+
omerEv.alarm = tzeit;
|
|
5968
|
+
}
|
|
5880
5969
|
}
|
|
5881
5970
|
|
|
5882
5971
|
evts.push(omerEv);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.37.0",
|
|
4
4
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Eyal Schachter (https://github.com/Scimonster)",
|
|
@@ -47,8 +47,9 @@
|
|
|
47
47
|
"pretest": "npm run build",
|
|
48
48
|
"typedef": "npx jsdoc -t node_modules/tsd-jsdoc/dist -r ./src/",
|
|
49
49
|
"lint": "eslint src",
|
|
50
|
-
"coverage": "nyc
|
|
51
|
-
"
|
|
50
|
+
"coverage-local": "nyc --concurrency 2",
|
|
51
|
+
"coverage": "nyc --reporter=lcov ava --concurrency 4 && codecov",
|
|
52
|
+
"test": "ava --concurrency 4"
|
|
52
53
|
},
|
|
53
54
|
"license": "GPL-2.0",
|
|
54
55
|
"ava": {
|
|
@@ -62,22 +63,23 @@
|
|
|
62
63
|
"verbose": true
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
65
|
-
"@babel/core": "^7.17.
|
|
66
|
-
"@babel/preset-env": "^7.
|
|
66
|
+
"@babel/core": "^7.17.10",
|
|
67
|
+
"@babel/preset-env": "^7.17.10",
|
|
67
68
|
"@babel/register": "^7.17.7",
|
|
68
69
|
"@hebcal/solar-calc": "^1.1.2",
|
|
69
70
|
"@rollup/plugin-babel": "^5.3.1",
|
|
70
71
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
71
72
|
"@rollup/plugin-json": "^4.1.0",
|
|
72
|
-
"@rollup/plugin-node-resolve": "^13.
|
|
73
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
73
74
|
"ava": "^4.2.0",
|
|
74
|
-
"
|
|
75
|
-
"
|
|
75
|
+
"codecov": "^3.8.3",
|
|
76
|
+
"core-js": "^3.22.5",
|
|
77
|
+
"eslint": "^8.15.0",
|
|
76
78
|
"eslint-config-google": "^0.14.0",
|
|
77
79
|
"jsdoc": "^3.6.10",
|
|
78
80
|
"jsdoc-to-markdown": "^7.1.1",
|
|
79
81
|
"nyc": "^15.1.0",
|
|
80
|
-
"rollup": "^2.
|
|
82
|
+
"rollup": "^2.72.1",
|
|
81
83
|
"rollup-plugin-terser": "^7.0.2",
|
|
82
84
|
"tsd-jsdoc": "^2.5.0",
|
|
83
85
|
"ttag-cli": "^1.9.3"
|