@hebcal/rest-api 5.2.0 → 6.0.1
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 +68 -756
- package/dist/bundle.min.js +2 -2
- package/dist/fullcalendar.js +28 -519
- package/dist/fullcalendar.min.js +2 -2
- package/dist/index.mjs +27 -714
- package/dist/{classic-rest-api.d.ts → src/classic-rest-api.d.ts} +2 -1
- package/dist/{common.d.ts → src/common.d.ts} +3 -1
- package/dist/{csv.d.ts → src/csv.d.ts} +1 -1
- package/dist/{fullcalendar.d.ts → src/fullcalendar.d.ts} +1 -1
- package/dist/{rss.d.ts → src/rss.d.ts} +1 -1
- package/package.json +19 -21
- package/dist/countryNames.json.d.ts +0 -203
- package/dist/holidays.json.d.ts +0 -70
- package/dist/index.cjs +0 -1544
- package/dist/module.d.ts +0 -117
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{makeAnchor.d.ts → src/makeAnchor.d.ts} +0 -0
- /package/dist/{shorten.d.ts → src/shorten.d.ts} +0 -0
package/dist/bundle.js
CHANGED
|
@@ -1,702 +1,10 @@
|
|
|
1
|
-
/*! @hebcal/rest-api
|
|
2
|
-
var hebcal__rest_api = (function (exports,
|
|
1
|
+
/*! @hebcal/rest-api v6.0.1 */
|
|
2
|
+
var hebcal__rest_api = (function (exports, event, reformatTimeStr, hdate, leyning, getLeyningForHoliday, sedra, zmanim, pkgVersion, locale, common) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
/** @private */
|
|
7
|
-
const lengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
8
|
-
/** @private */
|
|
9
|
-
const monthLengths = [lengths, lengths.slice()];
|
|
10
|
-
monthLengths[1][2] = 29;
|
|
11
|
-
/**
|
|
12
|
-
* @private
|
|
13
|
-
*/
|
|
14
|
-
function mod(x, y) {
|
|
15
|
-
return x - y * Math.floor(x / y);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @private
|
|
19
|
-
*/
|
|
20
|
-
function quotient(x, y) {
|
|
21
|
-
return Math.floor(x / y);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* @private
|
|
25
|
-
* @param abs - R.D. number of days
|
|
26
|
-
*/
|
|
27
|
-
function yearFromFixed(abs) {
|
|
28
|
-
const l0 = abs - 1;
|
|
29
|
-
const n400 = quotient(l0, 146097);
|
|
30
|
-
const d1 = mod(l0, 146097);
|
|
31
|
-
const n100 = quotient(d1, 36524);
|
|
32
|
-
const d2 = mod(d1, 36524);
|
|
33
|
-
const n4 = quotient(d2, 1461);
|
|
34
|
-
const d3 = mod(d2, 1461);
|
|
35
|
-
const n1 = quotient(d3, 365);
|
|
36
|
-
const year = 400 * n400 + 100 * n100 + 4 * n4 + n1;
|
|
37
|
-
return n100 !== 4 && n1 !== 4 ? year + 1 : year;
|
|
38
|
-
}
|
|
39
|
-
/*
|
|
40
|
-
const ABS_14SEP1752 = 639797;
|
|
41
|
-
const ABS_2SEP1752 = 639785;
|
|
42
|
-
*/
|
|
43
|
-
/*
|
|
44
|
-
* Formerly in namespace, now top-level
|
|
45
|
-
*/
|
|
46
|
-
/**
|
|
47
|
-
* Returns true if the Gregorian year is a leap year
|
|
48
|
-
* @param year Gregorian year
|
|
49
|
-
*/
|
|
50
|
-
function isGregLeapYear(year) {
|
|
51
|
-
return !(year % 4) && (!!(year % 100) || !(year % 400));
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Number of days in the Gregorian month for given year
|
|
55
|
-
* @param month Gregorian month (1=January, 12=December)
|
|
56
|
-
* @param year Gregorian year
|
|
57
|
-
*/
|
|
58
|
-
function daysInGregMonth(month, year) {
|
|
59
|
-
// 1 based months
|
|
60
|
-
return monthLengths[+isGregLeapYear(year)][month];
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Returns true if the object is a Javascript Date
|
|
64
|
-
*/
|
|
65
|
-
function isDate(obj) {
|
|
66
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
67
|
-
return typeof obj === 'object' && Date.prototype.isPrototypeOf(obj);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* @private
|
|
71
|
-
* @param year
|
|
72
|
-
* @param month (1-12)
|
|
73
|
-
* @param day (1-31)
|
|
74
|
-
*/
|
|
75
|
-
function toFixed(year, month, day) {
|
|
76
|
-
const py = year - 1;
|
|
77
|
-
return (365 * py +
|
|
78
|
-
quotient(py, 4) -
|
|
79
|
-
quotient(py, 100) +
|
|
80
|
-
quotient(py, 400) +
|
|
81
|
-
quotient(367 * month - 362, 12) +
|
|
82
|
-
(month <= 2 ? 0 : isGregLeapYear(year) ? -1 : -2) +
|
|
83
|
-
day);
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Converts Gregorian date to absolute R.D. (Rata Die) days
|
|
87
|
-
* @param date Gregorian date
|
|
88
|
-
*/
|
|
89
|
-
function greg2abs(date) {
|
|
90
|
-
if (!isDate(date)) {
|
|
91
|
-
throw new TypeError(`Argument not a Date: ${date}`);
|
|
92
|
-
}
|
|
93
|
-
const abs = toFixed(date.getFullYear(), date.getMonth() + 1, date.getDate());
|
|
94
|
-
/*
|
|
95
|
-
if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {
|
|
96
|
-
throw new RangeError(`Invalid Date: ${date}`);
|
|
97
|
-
}
|
|
98
|
-
*/
|
|
99
|
-
return abs;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Converts from Rata Die (R.D. number) to Gregorian date.
|
|
103
|
-
* See the footnote on page 384 of ``Calendrical Calculations, Part II:
|
|
104
|
-
* Three Historical Calendars'' by E. M. Reingold, N. Dershowitz, and S. M.
|
|
105
|
-
* Clamen, Software--Practice and Experience, Volume 23, Number 4
|
|
106
|
-
* (April, 1993), pages 383-404 for an explanation.
|
|
107
|
-
* @param abs - R.D. number of days
|
|
108
|
-
*/
|
|
109
|
-
function abs2greg(abs) {
|
|
110
|
-
if (typeof abs !== 'number') {
|
|
111
|
-
throw new TypeError(`Argument not a Number: ${abs}`);
|
|
112
|
-
}
|
|
113
|
-
abs = Math.trunc(abs);
|
|
114
|
-
/*
|
|
115
|
-
if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {
|
|
116
|
-
throw new RangeError(`Invalid Date: ${abs}`);
|
|
117
|
-
}
|
|
118
|
-
*/
|
|
119
|
-
const year = yearFromFixed(abs);
|
|
120
|
-
const priorDays = abs - toFixed(year, 1, 1);
|
|
121
|
-
const correction = abs < toFixed(year, 3, 1) ? 0 : isGregLeapYear(year) ? 1 : 2;
|
|
122
|
-
const month = quotient(12 * (priorDays + correction) + 373, 367);
|
|
123
|
-
const day = abs - toFixed(year, month, 1) + 1;
|
|
124
|
-
const dt = new Date(year, month - 1, day);
|
|
125
|
-
if (year < 100 && year >= 0) {
|
|
126
|
-
dt.setFullYear(year);
|
|
127
|
-
}
|
|
128
|
-
return dt;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */
|
|
132
|
-
/**
|
|
133
|
-
* Gregorian date helper functions
|
|
134
|
-
*/
|
|
135
|
-
var greg;
|
|
136
|
-
(function (greg) {
|
|
137
|
-
})(greg || (greg = {}));
|
|
138
|
-
greg.abs2greg = abs2greg;
|
|
139
|
-
greg.daysInMonth = daysInGregMonth;
|
|
140
|
-
greg.greg2abs = greg2abs;
|
|
141
|
-
greg.isDate = isDate;
|
|
142
|
-
greg.isLeapYear = isGregLeapYear;
|
|
5
|
+
const AD="Andorra";const AE="United Arab Emirates";const AF="Afghanistan";const AI="Anguilla";const AL="Albania";const AM="Armenia";const AO="Angola";const AR="Argentina";const AS="American Samoa";const AT="Austria";const AU="Australia";const AW="Aruba";const AZ="Azerbaijan";const BA="Bosnia and Herzegovina";const BB="Barbados";const BD="Bangladesh";const BE="Belgium";const BF="Burkina Faso";const BG="Bulgaria";const BH="Bahrain";const BI="Burundi";const BJ="Benin";const BM="Bermuda";const BN="Brunei";const BO="Bolivia";const BR="Brazil";const BS="Bahamas";const BT="Bhutan";const BW="Botswana";const BY="Belarus";const BZ="Belize";const CA="Canada";const CD="Democratic Republic of the Congo";const CF="Central African Republic";const CG="Republic of the Congo";const CH="Switzerland";const CI="Ivory Coast";const CK="Cook Islands";const CL="Chile";const CM="Cameroon";const CN="China";const CO="Colombia";const CR="Costa Rica";const CU="Cuba";const CV="Cape Verde";const CW="Curacao";const CY="Cyprus";const CZ="Czech Republic";const DE="Germany";const DK="Denmark";const DM="Dominica";const DO="Dominican Republic";const DZ="Algeria";const EC="Ecuador";const EE="Estonia";const EG="Egypt";const ER="Eritrea";const ES="Spain";const ET="Ethiopia";const FI="Finland";const FJ="Fiji";const FK="Falkland Islands";const FO="Faroe Islands";const FR="France";const GA="Gabon";const GB="United Kingdom";const GE="Georgia";const GH="Ghana";const GI="Gibraltar";const GL="Greenland";const GM="Gambia";const GN="Guinea";const GQ="Equatorial Guinea";const GR="Greece";const GT="Guatemala";const GW="Guinea-Bissau";const GY="Guyana";const HK="Hong Kong";const HN="Honduras";const HR="Croatia";const HT="Haiti";const HU="Hungary";const ID="Indonesia";const IE="Ireland";const IL="Israel";const IM="Isle of Man";const IN="India";const IQ="Iraq";const IR="Iran";const IS="Iceland";const IT="Italy";const JM="Jamaica";const JO="Jordan";const JP="Japan";const KE="Kenya";const KG="Kyrgyzstan";const KH="Cambodia";const KM="Comoros";const KN="Saint Kitts and Nevis";const KP="North Korea";const KR="South Korea";const KW="Kuwait";const KY="Cayman Islands";const KZ="Kazakhstan";const LA="Laos";const LB="Lebanon";const LC="Saint Lucia";const LI="Liechtenstein";const LR="Liberia";const LS="Lesotho";const LT="Lithuania";const LU="Luxembourg";const LV="Latvia";const LY="Libya";const MA="Morocco";const MD="Moldova";const ME="Montenegro";const MG="Madagascar";const MK="Macedonia";const ML="Mali";const MM="Myanmar";const MN="Mongolia";const MP="Northern Mariana Islands";const MR="Mauritania";const MS="Montserrat";const MT="Malta";const MU="Mauritius";const MW="Malawi";const MX="Mexico";const MY="Malaysia";const MZ="Mozambique";const NA="Namibia";const NC="New Caledonia";const NE="Niger";const NG="Nigeria";const NI="Nicaragua";const NL="Netherlands";const NO="Norway";const NP="Nepal";const NU="Niue";const NZ="New Zealand";const OM="Oman";const PA="Panama";const PE="Peru";const PF="French Polynesia";const PG="Papua New Guinea";const PH="Philippines";const PK="Pakistan";const PL="Poland";const PR="Puerto Rico";const PT="Portugal";const PY="Paraguay";const QA="Qatar";const RO="Romania";const RS="Serbia";const RU="Russia";const RW="Rwanda";const SA="Saudi Arabia";const SB="Solomon Islands";const SC="Seychelles";const SD="Sudan";const SE="Sweden";const SG="Singapore";const SH="Saint Helena";const SI="Slovenia";const SK="Slovakia";const SL="Sierra Leone";const SN="Senegal";const SO="Somalia";const SR="Suriname";const ST="Sao Tome and Principe";const SV="El Salvador";const SY="Syria";const SZ="Swaziland";const TC="Turks and Caicos Islands";const TD="Chad";const TG="Togo";const TH="Thailand";const TJ="Tajikistan";const TM="Turkmenistan";const TN="Tunisia";const TR="Turkey";const TV="Tuvalu";const TW="Taiwan";const TZ="Tanzania";const UA="Ukraine";const UG="Uganda";const US="United States";const UY="Uruguay";const UZ="Uzbekistan";const VC="Saint Vincent and the Grenadines";const VE="Venezuela";const VG="British Virgin Islands";const VN="Vietnam";const WS="Samoa";const YE="Yemen";const YT="Mayotte";const ZA="South Africa";const ZM="Zambia";const ZW="Zimbabwe";var countryNames0 = {AD:AD,AE:AE,AF:AF,AI:AI,AL:AL,AM:AM,AO:AO,AR:AR,AS:AS,AT:AT,AU:AU,AW:AW,AZ:AZ,BA:BA,BB:BB,BD:BD,BE:BE,BF:BF,BG:BG,BH:BH,BI:BI,BJ:BJ,BM:BM,BN:BN,BO:BO,BR:BR,BS:BS,BT:BT,BW:BW,BY:BY,BZ:BZ,CA:CA,CD:CD,CF:CF,CG:CG,CH:CH,CI:CI,CK:CK,CL:CL,CM:CM,CN:CN,CO:CO,CR:CR,CU:CU,CV:CV,CW:CW,CY:CY,CZ:CZ,DE:DE,DK:DK,DM:DM,DO:DO,DZ:DZ,EC:EC,EE:EE,EG:EG,ER:ER,ES:ES,ET:ET,FI:FI,FJ:FJ,FK:FK,FO:FO,FR:FR,GA:GA,GB:GB,GE:GE,GH:GH,GI:GI,GL:GL,GM:GM,GN:GN,GQ:GQ,GR:GR,GT:GT,GW:GW,GY:GY,HK:HK,HN:HN,HR:HR,HT:HT,HU:HU,ID:ID,IE:IE,IL:IL,IM:IM,IN:IN,IQ:IQ,IR:IR,IS:IS,IT:IT,JM:JM,JO:JO,JP:JP,KE:KE,KG:KG,KH:KH,KM:KM,KN:KN,KP:KP,KR:KR,KW:KW,KY:KY,KZ:KZ,LA:LA,LB:LB,LC:LC,LI:LI,LR:LR,LS:LS,LT:LT,LU:LU,LV:LV,LY:LY,MA:MA,MD:MD,ME:ME,MG:MG,MK:MK,ML:ML,MM:MM,MN:MN,MP:MP,MR:MR,MS:MS,MT:MT,MU:MU,MW:MW,MX:MX,MY:MY,MZ:MZ,NA:NA,NC:NC,NE:NE,NG:NG,NI:NI,NL:NL,NO:NO,NP:NP,NU:NU,NZ:NZ,OM:OM,PA:PA,PE:PE,PF:PF,PG:PG,PH:PH,PK:PK,PL:PL,PR:PR,PT:PT,PY:PY,QA:QA,RO:RO,RS:RS,RU:RU,RW:RW,SA:SA,SB:SB,SC:SC,SD:SD,SE:SE,SG:SG,SH:SH,SI:SI,SK:SK,SL:SL,SN:SN,SO:SO,SR:SR,ST:ST,SV:SV,SY:SY,SZ:SZ,TC:TC,TD:TD,TG:TG,TH:TH,TJ:TJ,TM:TM,TN:TN,TR:TR,TV:TV,TW:TW,TZ:TZ,UA:UA,UG:UG,US:US,UY:UY,UZ:UZ,VC:VC,VE:VE,VG:VG,VN:VN,WS:WS,YE:YE,YT:YT,ZA:ZA,ZM:ZM,ZW:ZW};
|
|
143
6
|
|
|
144
|
-
const alefbet = {
|
|
145
|
-
א: 1,
|
|
146
|
-
ב: 2,
|
|
147
|
-
ג: 3,
|
|
148
|
-
ד: 4,
|
|
149
|
-
ה: 5,
|
|
150
|
-
ו: 6,
|
|
151
|
-
ז: 7,
|
|
152
|
-
ח: 8,
|
|
153
|
-
ט: 9,
|
|
154
|
-
י: 10,
|
|
155
|
-
כ: 20,
|
|
156
|
-
ל: 30,
|
|
157
|
-
מ: 40,
|
|
158
|
-
נ: 50,
|
|
159
|
-
ס: 60,
|
|
160
|
-
ע: 70,
|
|
161
|
-
פ: 80,
|
|
162
|
-
צ: 90,
|
|
163
|
-
ק: 100,
|
|
164
|
-
ר: 200,
|
|
165
|
-
ש: 300,
|
|
166
|
-
ת: 400,
|
|
167
|
-
};
|
|
168
|
-
const heb2num = new Map();
|
|
169
|
-
const num2heb = new Map();
|
|
170
|
-
for (const [key, val] of Object.entries(alefbet)) {
|
|
171
|
-
heb2num.set(key, val);
|
|
172
|
-
num2heb.set(val, key);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Formats a number with leading zeros so the resulting string is 4 digits long.
|
|
177
|
-
* Similar to `string.padStart(4, '0')` but will also format
|
|
178
|
-
* negative numbers similar to how the JavaScript date formats
|
|
179
|
-
* negative year numbers (e.g. `-37` is formatted as `-000037`).
|
|
180
|
-
*/
|
|
181
|
-
function pad4(num) {
|
|
182
|
-
if (num < 0) {
|
|
183
|
-
return '-00' + pad4(-num);
|
|
184
|
-
}
|
|
185
|
-
else if (num < 10) {
|
|
186
|
-
return '000' + num;
|
|
187
|
-
}
|
|
188
|
-
else if (num < 100) {
|
|
189
|
-
return '00' + num;
|
|
190
|
-
}
|
|
191
|
-
else if (num < 1000) {
|
|
192
|
-
return '0' + num;
|
|
193
|
-
}
|
|
194
|
-
return String(num);
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Formats a number with leading zeros so the resulting string is 2 digits long.
|
|
198
|
-
* Similar to `string.padStart(2, '0')`.
|
|
199
|
-
*/
|
|
200
|
-
function pad2(num) {
|
|
201
|
-
if (num >= 0 && num < 10) {
|
|
202
|
-
return '0' + num;
|
|
203
|
-
}
|
|
204
|
-
return String(num);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Returns YYYY-MM-DD in the local timezone
|
|
209
|
-
*/
|
|
210
|
-
function isoDateString(dt) {
|
|
211
|
-
return (pad4(dt.getFullYear()) +
|
|
212
|
-
'-' +
|
|
213
|
-
pad2(dt.getMonth() + 1) +
|
|
214
|
-
'-' +
|
|
215
|
-
pad2(dt.getDate()));
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
var poAshkenazi = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);" }, "contexts": { "": { "Tevet": ["Teves"] } } };
|
|
219
|
-
|
|
220
|
-
var poHe = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);" }, "contexts": { "": { "Adar": ["אַדָר"], "Adar I": ["אַדָר א׳"], "Adar II": ["אַדָר ב׳"], "Av": ["אָב"], "Cheshvan": ["חֶשְׁוָן"], "Elul": ["אֱלוּל"], "Iyyar": ["אִיָיר"], "Kislev": ["כִּסְלֵו"], "Nisan": ["נִיסָן"], "Sh'vat": ["שְׁבָט"], "Sivan": ["סִיוָן"], "Tamuz": ["תַּמּוּז"], "Tevet": ["טֵבֵת"], "Tishrei": ["תִּשְׁרֵי"] } } };
|
|
221
|
-
|
|
222
|
-
const noopLocale = {
|
|
223
|
-
headers: { 'plural-forms': 'nplurals=2; plural=(n!=1);' },
|
|
224
|
-
contexts: { '': {} },
|
|
225
|
-
};
|
|
226
|
-
const alias = {
|
|
227
|
-
h: 'he',
|
|
228
|
-
a: 'ashkenazi',
|
|
229
|
-
s: 'en',
|
|
230
|
-
'': 'en',
|
|
231
|
-
};
|
|
232
|
-
/** @private */
|
|
233
|
-
const locales = new Map();
|
|
234
|
-
/** @private */
|
|
235
|
-
let activeLocale;
|
|
236
|
-
/** @private */
|
|
237
|
-
let activeName;
|
|
238
|
-
/** @private */
|
|
239
|
-
function getEnOrdinal(n) {
|
|
240
|
-
const s = ['th', 'st', 'nd', 'rd'];
|
|
241
|
-
const v = n % 100;
|
|
242
|
-
return n + (s[(v - 20) % 10] || s[v] || s[0]);
|
|
243
|
-
}
|
|
244
|
-
/** @private */
|
|
245
|
-
function checkLocale(locale) {
|
|
246
|
-
if (typeof locale !== 'string') {
|
|
247
|
-
throw new TypeError(`Invalid locale name: ${locale}`);
|
|
248
|
-
}
|
|
249
|
-
return locale.toLowerCase();
|
|
250
|
-
}
|
|
251
|
-
/** @private */
|
|
252
|
-
function getExistingLocale(locale) {
|
|
253
|
-
const locale1 = checkLocale(locale);
|
|
254
|
-
const loc = locales.get(locale1);
|
|
255
|
-
if (!loc) {
|
|
256
|
-
throw new RangeError(`Locale '${locale}' not found`);
|
|
257
|
-
}
|
|
258
|
-
return loc;
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* A locale in Hebcal is used for translations/transliterations of
|
|
262
|
-
* holidays. `@hebcal/hdate` supports four locales by default
|
|
263
|
-
* * `en` - default, Sephardic transliterations (e.g. "Shabbat")
|
|
264
|
-
* * `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
|
|
265
|
-
* * `he` - Hebrew (e.g. "שַׁבָּת")
|
|
266
|
-
* * `he-x-NoNikud` - Hebrew without nikud (e.g. "שבת")
|
|
267
|
-
*/
|
|
268
|
-
class Locale {
|
|
269
|
-
/**
|
|
270
|
-
* Returns translation only if `locale` offers a non-empty translation for `id`.
|
|
271
|
-
* Otherwise, returns `undefined`.
|
|
272
|
-
* @param id Message ID to translate
|
|
273
|
-
* @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
|
|
274
|
-
*/
|
|
275
|
-
static lookupTranslation(id, locale) {
|
|
276
|
-
const loc = (typeof locale === 'string' && locales.get(locale.toLowerCase())) ||
|
|
277
|
-
activeLocale;
|
|
278
|
-
const array = loc[id];
|
|
279
|
-
if ((array === null || array === void 0 ? void 0 : array.length) && array[0].length) {
|
|
280
|
-
return array[0];
|
|
281
|
-
}
|
|
282
|
-
return undefined;
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* By default, if no translation was found, returns `id`.
|
|
286
|
-
* @param id Message ID to translate
|
|
287
|
-
* @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
|
|
288
|
-
*/
|
|
289
|
-
static gettext(id, locale) {
|
|
290
|
-
const text = this.lookupTranslation(id, locale);
|
|
291
|
-
if (typeof text === 'undefined') {
|
|
292
|
-
return id;
|
|
293
|
-
}
|
|
294
|
-
return text;
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Register locale translations.
|
|
298
|
-
* @param locale Locale name (i.e.: `'he'`, `'fr'`)
|
|
299
|
-
* @param data parsed data from a `.po` file.
|
|
300
|
-
*/
|
|
301
|
-
static addLocale(locale, data) {
|
|
302
|
-
locale = checkLocale(locale);
|
|
303
|
-
if (typeof data.contexts !== 'object' ||
|
|
304
|
-
typeof data.contexts[''] !== 'object') {
|
|
305
|
-
throw new TypeError(`Locale '${locale}' invalid compact format`);
|
|
306
|
-
}
|
|
307
|
-
locales.set(locale, data.contexts['']);
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* Adds a translation to `locale`, replacing any previous translation.
|
|
311
|
-
* @param locale Locale name (i.e: `'he'`, `'fr'`).
|
|
312
|
-
* @param id Message ID to translate
|
|
313
|
-
* @param translation Translation text
|
|
314
|
-
*/
|
|
315
|
-
static addTranslation(locale, id, translation) {
|
|
316
|
-
const loc = getExistingLocale(locale);
|
|
317
|
-
if (typeof id !== 'string' || id.length === 0) {
|
|
318
|
-
throw new TypeError(`Invalid id string: ${id}`);
|
|
319
|
-
}
|
|
320
|
-
const isArray = Array.isArray(translation);
|
|
321
|
-
if (isArray) {
|
|
322
|
-
const t0 = translation[0];
|
|
323
|
-
if (typeof t0 !== 'string' || t0.length === 0) {
|
|
324
|
-
throw new TypeError(`Invalid translation array: ${translation}`);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
else if (typeof translation !== 'string') {
|
|
328
|
-
throw new TypeError(`Invalid translation string: ${translation}`);
|
|
329
|
-
}
|
|
330
|
-
loc[id] = isArray ? translation : [translation];
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Adds multiple translations to `locale`, replacing any previous translations.
|
|
334
|
-
* @param locale Locale name (i.e: `'he'`, `'fr'`).
|
|
335
|
-
* @param data parsed data from a `.po` file.
|
|
336
|
-
*/
|
|
337
|
-
static addTranslations(locale, data) {
|
|
338
|
-
const loc = getExistingLocale(locale);
|
|
339
|
-
if (typeof data.contexts !== 'object' ||
|
|
340
|
-
typeof data.contexts[''] !== 'object') {
|
|
341
|
-
throw new TypeError(`Locale '${locale}' invalid compact format`);
|
|
342
|
-
}
|
|
343
|
-
const ctx = data.contexts[''];
|
|
344
|
-
Object.assign(loc, ctx);
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* Activates a locale. Throws an error if the locale has not been previously added.
|
|
348
|
-
* After setting the locale to be used, all strings marked for translations
|
|
349
|
-
* will be represented by the corresponding translation in the specified locale.
|
|
350
|
-
* @param locale Locale name (i.e: `'he'`, `'fr'`)
|
|
351
|
-
*/
|
|
352
|
-
static useLocale(locale) {
|
|
353
|
-
const locale0 = checkLocale(locale);
|
|
354
|
-
const obj = getExistingLocale(locale0);
|
|
355
|
-
activeName = alias[locale0] || locale0;
|
|
356
|
-
activeLocale = obj;
|
|
357
|
-
return activeLocale;
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Returns the name of the active locale (i.e. 'he', 'ashkenazi', 'fr')
|
|
361
|
-
*/
|
|
362
|
-
static getLocaleName() {
|
|
363
|
-
return activeName;
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
* Returns the names of registered locales
|
|
367
|
-
*/
|
|
368
|
-
static getLocaleNames() {
|
|
369
|
-
const keys = Array.from(locales.keys());
|
|
370
|
-
return keys.sort((a, b) => a.localeCompare(b));
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* Renders a number in ordinal, such as 1st, 2nd or 3rd
|
|
374
|
-
* @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
|
|
375
|
-
*/
|
|
376
|
-
static ordinal(n, locale) {
|
|
377
|
-
const locale1 = locale === null || locale === void 0 ? void 0 : locale.toLowerCase();
|
|
378
|
-
const locale0 = locale1 || activeName;
|
|
379
|
-
if (!locale0) {
|
|
380
|
-
return getEnOrdinal(n);
|
|
381
|
-
}
|
|
382
|
-
switch (locale0) {
|
|
383
|
-
case 'en':
|
|
384
|
-
case 's':
|
|
385
|
-
case 'a':
|
|
386
|
-
return getEnOrdinal(n);
|
|
387
|
-
case 'es':
|
|
388
|
-
return n + 'º';
|
|
389
|
-
case 'h':
|
|
390
|
-
case 'he':
|
|
391
|
-
case 'he-x-nonikud':
|
|
392
|
-
return String(n);
|
|
393
|
-
}
|
|
394
|
-
if (locale0.startsWith('ashkenazi')) {
|
|
395
|
-
return getEnOrdinal(n);
|
|
396
|
-
}
|
|
397
|
-
return n + '.';
|
|
398
|
-
}
|
|
399
|
-
/**
|
|
400
|
-
* Removes nekudot from Hebrew string
|
|
401
|
-
*/
|
|
402
|
-
static hebrewStripNikkud(str) {
|
|
403
|
-
return str.replace(/[\u0590-\u05bd]/g, '').replace(/[\u05bf-\u05c7]/g, '');
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
Locale.addLocale('en', noopLocale);
|
|
407
|
-
Locale.addLocale('s', noopLocale);
|
|
408
|
-
Locale.addLocale('', noopLocale);
|
|
409
|
-
Locale.useLocale('en');
|
|
410
|
-
/* Ashkenazic transliterations */
|
|
411
|
-
Locale.addLocale('ashkenazi', poAshkenazi);
|
|
412
|
-
Locale.addLocale('a', poAshkenazi);
|
|
413
|
-
/* Hebrew with nikkud */
|
|
414
|
-
Locale.addLocale('he', poHe);
|
|
415
|
-
Locale.addLocale('h', poHe);
|
|
416
|
-
/* Hebrew without nikkud */
|
|
417
|
-
const heStrs = poHe.contexts[''];
|
|
418
|
-
const heNoNikud = {};
|
|
419
|
-
for (const [key, val] of Object.entries(heStrs)) {
|
|
420
|
-
heNoNikud[key] = [Locale.hebrewStripNikkud(val[0])];
|
|
421
|
-
}
|
|
422
|
-
const poHeNoNikud = {
|
|
423
|
-
headers: poHe.headers,
|
|
424
|
-
contexts: { '': heNoNikud },
|
|
425
|
-
};
|
|
426
|
-
Locale.addLocale('he-x-NoNikud', poHeNoNikud);
|
|
427
|
-
|
|
428
|
-
var countryNames0 = {
|
|
429
|
-
"AD": "Andorra",
|
|
430
|
-
"AE": "United Arab Emirates",
|
|
431
|
-
"AF": "Afghanistan",
|
|
432
|
-
"AI": "Anguilla",
|
|
433
|
-
"AL": "Albania",
|
|
434
|
-
"AM": "Armenia",
|
|
435
|
-
"AO": "Angola",
|
|
436
|
-
"AR": "Argentina",
|
|
437
|
-
"AS": "American Samoa",
|
|
438
|
-
"AT": "Austria",
|
|
439
|
-
"AU": "Australia",
|
|
440
|
-
"AW": "Aruba",
|
|
441
|
-
"AZ": "Azerbaijan",
|
|
442
|
-
"BA": "Bosnia and Herzegovina",
|
|
443
|
-
"BB": "Barbados",
|
|
444
|
-
"BD": "Bangladesh",
|
|
445
|
-
"BE": "Belgium",
|
|
446
|
-
"BF": "Burkina Faso",
|
|
447
|
-
"BG": "Bulgaria",
|
|
448
|
-
"BH": "Bahrain",
|
|
449
|
-
"BI": "Burundi",
|
|
450
|
-
"BJ": "Benin",
|
|
451
|
-
"BM": "Bermuda",
|
|
452
|
-
"BN": "Brunei",
|
|
453
|
-
"BO": "Bolivia",
|
|
454
|
-
"BR": "Brazil",
|
|
455
|
-
"BS": "Bahamas",
|
|
456
|
-
"BT": "Bhutan",
|
|
457
|
-
"BW": "Botswana",
|
|
458
|
-
"BY": "Belarus",
|
|
459
|
-
"BZ": "Belize",
|
|
460
|
-
"CA": "Canada",
|
|
461
|
-
"CD": "Democratic Republic of the Congo",
|
|
462
|
-
"CF": "Central African Republic",
|
|
463
|
-
"CG": "Republic of the Congo",
|
|
464
|
-
"CH": "Switzerland",
|
|
465
|
-
"CI": "Ivory Coast",
|
|
466
|
-
"CK": "Cook Islands",
|
|
467
|
-
"CL": "Chile",
|
|
468
|
-
"CM": "Cameroon",
|
|
469
|
-
"CN": "China",
|
|
470
|
-
"CO": "Colombia",
|
|
471
|
-
"CR": "Costa Rica",
|
|
472
|
-
"CU": "Cuba",
|
|
473
|
-
"CV": "Cape Verde",
|
|
474
|
-
"CW": "Curacao",
|
|
475
|
-
"CY": "Cyprus",
|
|
476
|
-
"CZ": "Czech Republic",
|
|
477
|
-
"DE": "Germany",
|
|
478
|
-
"DK": "Denmark",
|
|
479
|
-
"DM": "Dominica",
|
|
480
|
-
"DO": "Dominican Republic",
|
|
481
|
-
"DZ": "Algeria",
|
|
482
|
-
"EC": "Ecuador",
|
|
483
|
-
"EE": "Estonia",
|
|
484
|
-
"EG": "Egypt",
|
|
485
|
-
"ER": "Eritrea",
|
|
486
|
-
"ES": "Spain",
|
|
487
|
-
"ET": "Ethiopia",
|
|
488
|
-
"FI": "Finland",
|
|
489
|
-
"FJ": "Fiji",
|
|
490
|
-
"FK": "Falkland Islands",
|
|
491
|
-
"FO": "Faroe Islands",
|
|
492
|
-
"FR": "France",
|
|
493
|
-
"GA": "Gabon",
|
|
494
|
-
"GB": "United Kingdom",
|
|
495
|
-
"GE": "Georgia",
|
|
496
|
-
"GH": "Ghana",
|
|
497
|
-
"GI": "Gibraltar",
|
|
498
|
-
"GL": "Greenland",
|
|
499
|
-
"GM": "Gambia",
|
|
500
|
-
"GN": "Guinea",
|
|
501
|
-
"GQ": "Equatorial Guinea",
|
|
502
|
-
"GR": "Greece",
|
|
503
|
-
"GT": "Guatemala",
|
|
504
|
-
"GW": "Guinea-Bissau",
|
|
505
|
-
"GY": "Guyana",
|
|
506
|
-
"HK": "Hong Kong",
|
|
507
|
-
"HN": "Honduras",
|
|
508
|
-
"HR": "Croatia",
|
|
509
|
-
"HT": "Haiti",
|
|
510
|
-
"HU": "Hungary",
|
|
511
|
-
"ID": "Indonesia",
|
|
512
|
-
"IE": "Ireland",
|
|
513
|
-
"IL": "Israel",
|
|
514
|
-
"IM": "Isle of Man",
|
|
515
|
-
"IN": "India",
|
|
516
|
-
"IQ": "Iraq",
|
|
517
|
-
"IR": "Iran",
|
|
518
|
-
"IS": "Iceland",
|
|
519
|
-
"IT": "Italy",
|
|
520
|
-
"JM": "Jamaica",
|
|
521
|
-
"JO": "Jordan",
|
|
522
|
-
"JP": "Japan",
|
|
523
|
-
"KE": "Kenya",
|
|
524
|
-
"KG": "Kyrgyzstan",
|
|
525
|
-
"KH": "Cambodia",
|
|
526
|
-
"KM": "Comoros",
|
|
527
|
-
"KN": "Saint Kitts and Nevis",
|
|
528
|
-
"KP": "North Korea",
|
|
529
|
-
"KR": "South Korea",
|
|
530
|
-
"KW": "Kuwait",
|
|
531
|
-
"KY": "Cayman Islands",
|
|
532
|
-
"KZ": "Kazakhstan",
|
|
533
|
-
"LA": "Laos",
|
|
534
|
-
"LB": "Lebanon",
|
|
535
|
-
"LC": "Saint Lucia",
|
|
536
|
-
"LI": "Liechtenstein",
|
|
537
|
-
"LR": "Liberia",
|
|
538
|
-
"LS": "Lesotho",
|
|
539
|
-
"LT": "Lithuania",
|
|
540
|
-
"LU": "Luxembourg",
|
|
541
|
-
"LV": "Latvia",
|
|
542
|
-
"LY": "Libya",
|
|
543
|
-
"MA": "Morocco",
|
|
544
|
-
"MD": "Moldova",
|
|
545
|
-
"ME": "Montenegro",
|
|
546
|
-
"MG": "Madagascar",
|
|
547
|
-
"MK": "Macedonia",
|
|
548
|
-
"ML": "Mali",
|
|
549
|
-
"MM": "Myanmar",
|
|
550
|
-
"MN": "Mongolia",
|
|
551
|
-
"MP": "Northern Mariana Islands",
|
|
552
|
-
"MR": "Mauritania",
|
|
553
|
-
"MS": "Montserrat",
|
|
554
|
-
"MT": "Malta",
|
|
555
|
-
"MU": "Mauritius",
|
|
556
|
-
"MW": "Malawi",
|
|
557
|
-
"MX": "Mexico",
|
|
558
|
-
"MY": "Malaysia",
|
|
559
|
-
"MZ": "Mozambique",
|
|
560
|
-
"NA": "Namibia",
|
|
561
|
-
"NC": "New Caledonia",
|
|
562
|
-
"NE": "Niger",
|
|
563
|
-
"NG": "Nigeria",
|
|
564
|
-
"NI": "Nicaragua",
|
|
565
|
-
"NL": "Netherlands",
|
|
566
|
-
"NO": "Norway",
|
|
567
|
-
"NP": "Nepal",
|
|
568
|
-
"NU": "Niue",
|
|
569
|
-
"NZ": "New Zealand",
|
|
570
|
-
"OM": "Oman",
|
|
571
|
-
"PA": "Panama",
|
|
572
|
-
"PE": "Peru",
|
|
573
|
-
"PF": "French Polynesia",
|
|
574
|
-
"PG": "Papua New Guinea",
|
|
575
|
-
"PH": "Philippines",
|
|
576
|
-
"PK": "Pakistan",
|
|
577
|
-
"PL": "Poland",
|
|
578
|
-
"PR": "Puerto Rico",
|
|
579
|
-
"PT": "Portugal",
|
|
580
|
-
"PY": "Paraguay",
|
|
581
|
-
"QA": "Qatar",
|
|
582
|
-
"RO": "Romania",
|
|
583
|
-
"RS": "Serbia",
|
|
584
|
-
"RU": "Russia",
|
|
585
|
-
"RW": "Rwanda",
|
|
586
|
-
"SA": "Saudi Arabia",
|
|
587
|
-
"SB": "Solomon Islands",
|
|
588
|
-
"SC": "Seychelles",
|
|
589
|
-
"SD": "Sudan",
|
|
590
|
-
"SE": "Sweden",
|
|
591
|
-
"SG": "Singapore",
|
|
592
|
-
"SH": "Saint Helena",
|
|
593
|
-
"SI": "Slovenia",
|
|
594
|
-
"SK": "Slovakia",
|
|
595
|
-
"SL": "Sierra Leone",
|
|
596
|
-
"SN": "Senegal",
|
|
597
|
-
"SO": "Somalia",
|
|
598
|
-
"SR": "Suriname",
|
|
599
|
-
"ST": "Sao Tome and Principe",
|
|
600
|
-
"SV": "El Salvador",
|
|
601
|
-
"SY": "Syria",
|
|
602
|
-
"SZ": "Swaziland",
|
|
603
|
-
"TC": "Turks and Caicos Islands",
|
|
604
|
-
"TD": "Chad",
|
|
605
|
-
"TG": "Togo",
|
|
606
|
-
"TH": "Thailand",
|
|
607
|
-
"TJ": "Tajikistan",
|
|
608
|
-
"TM": "Turkmenistan",
|
|
609
|
-
"TN": "Tunisia",
|
|
610
|
-
"TR": "Turkey",
|
|
611
|
-
"TV": "Tuvalu",
|
|
612
|
-
"TW": "Taiwan",
|
|
613
|
-
"TZ": "Tanzania",
|
|
614
|
-
"UA": "Ukraine",
|
|
615
|
-
"UG": "Uganda",
|
|
616
|
-
"US": "United States",
|
|
617
|
-
"UY": "Uruguay",
|
|
618
|
-
"UZ": "Uzbekistan",
|
|
619
|
-
"VC": "Saint Vincent and the Grenadines",
|
|
620
|
-
"VE": "Venezuela",
|
|
621
|
-
"VG": "British Virgin Islands",
|
|
622
|
-
"VN": "Vietnam",
|
|
623
|
-
"WS": "Samoa",
|
|
624
|
-
"YE": "Yemen",
|
|
625
|
-
"YT": "Mayotte",
|
|
626
|
-
"ZA": "South Africa",
|
|
627
|
-
"ZM": "Zambia",
|
|
628
|
-
"ZW": "Zimbabwe"
|
|
629
|
-
};
|
|
630
|
-
|
|
631
|
-
var holidayDescription0 = {
|
|
632
|
-
"Asara B'Tevet": "Fast commemorating the siege of Jerusalem",
|
|
633
|
-
"Ben-Gurion Day": "Commemorates the life and vision of Israel's first Prime Minister David Ben-Gurion",
|
|
634
|
-
"Birkat Hachamah": "A rare Jewish blessing recited once every 28 years thanking G-d for creating the sun",
|
|
635
|
-
"Chag HaBanot": "North African Chanukah festival of daughters. Called Eid al-Banat in Arabic, the holiday was most preserved in Tunisia",
|
|
636
|
-
"Chanukah": "Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights, the eight-day festival is observed by lighting the candles of a hanukkiah (menorah)",
|
|
637
|
-
"Days of the Omer": "7 weeks from the second night of Pesach to the day before Shavuot. Also called Sefirat HaOmer, it is a practice that consists of a verbal counting of each of the forty-nine days between the two holidays",
|
|
638
|
-
"Family Day": "Yom HaMishpacha, a day to honor the family unit",
|
|
639
|
-
"Hebrew Language Day": "Promotes the Hebrew language in Israel and around the world. Occurs on the birthday of Eliezer Ben Yehuda, the father of modern spoken Hebrew",
|
|
640
|
-
"Herzl Day": "Commemorates the life and vision of Zionist leader Theodor Herzl",
|
|
641
|
-
"Jabotinsky Day": "Commemorates the life and vision of Zionist leader Ze'ev Jabotinsky",
|
|
642
|
-
"Lag BaOmer": "33rd day of counting the Omer. The holiday is a temporary break from the semi-mourning period the counting of the Omer. Practices include lighting bonfires, getting haircuts, and Jewish weddings",
|
|
643
|
-
"Leil Selichot": "Prayers for forgiveness in preparation for the High Holidays",
|
|
644
|
-
"Pesach Sheni": "Second Passover, one month after Passover",
|
|
645
|
-
"Pesach": "Passover, the Feast of Unleavened Bread. Also called Chag HaMatzot (the Festival of Matzah), it commemorates the Exodus and freedom of the Israelites from ancient Egypt",
|
|
646
|
-
"Purim Katan": "Minor Purim celebration during Adar I on leap years",
|
|
647
|
-
"Purim": "Celebration of Jewish deliverance as told by Megilat Esther. It commemorates a time when the Jewish people living in Persia were saved from extermination",
|
|
648
|
-
"Purim Meshulash": "Triple Purim, spanning 3 days in Jerusalem and walled cities. It occurs when the 15th of Adar coincides with Shabbat",
|
|
649
|
-
"Rosh Chodesh Nisan": "Start of month of Nisan on the Hebrew calendar. נִיסָן (transliterated Nisan or Nissan) is the 1st month of the Hebrew year, has 30 days, and corresponds to March or April on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon",
|
|
650
|
-
"Rosh Chodesh Iyyar": "Start of month of Iyyar on the Hebrew calendar. אִיָיר (transliterated Iyyar or Iyar) is the 2nd month of the Hebrew year, has 29 days, and corresponds to April or May on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon",
|
|
651
|
-
"Rosh Chodesh Sivan": "Start of month of Sivan on the Hebrew calendar. Sivan (סִיוָן) is the 3rd month of the Hebrew year, has 30 days, and corresponds to May or June on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon",
|
|
652
|
-
"Rosh Chodesh Tamuz": "Start of month of Tamuz on the Hebrew calendar. תַּמּוּז (transliterated Tamuz or Tammuz) is the 4th month of the Hebrew year, has 29 days, and corresponds to June or July on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon",
|
|
653
|
-
"Rosh Chodesh Av": "Start of month of Av on the Hebrew calendar. Av (אָב) is the 5th month of the Hebrew year, has 30 days, and corresponds to July or August on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon",
|
|
654
|
-
"Rosh Chodesh Elul": "Start of month of Elul on the Hebrew calendar. Elul (אֱלוּל) is the 6th month of the Hebrew year, has 29 days, and corresponds to August or September on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon",
|
|
655
|
-
"Rosh Chodesh Cheshvan": "Start of month of Cheshvan on the Hebrew calendar. חֶשְׁוָן (transliterated Cheshvan or Heshvan) is the 8th month of the Hebrew year, has 29 or 30 days, and corresponds to October or November on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon",
|
|
656
|
-
"Rosh Chodesh Kislev": "Start of month of Kislev on the Hebrew calendar. Kislev (כִּסְלֵו) is the 9th month of the Hebrew year, has 30 or 29 days, and corresponds to November or December on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon",
|
|
657
|
-
"Rosh Chodesh Tevet": "Start of month of Tevet on the Hebrew calendar. Tevet (טֵבֵת) is the 10th month of the Hebrew year, has 29 days, and corresponds to December or January on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon",
|
|
658
|
-
"Rosh Chodesh Sh'vat": "Start of month of Sh'vat on the Hebrew calendar. שְׁבָט (transliterated Sh'vat or Shevat) is the 11th month of the Hebrew year, has 30 days, and corresponds to January or February on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon",
|
|
659
|
-
"Rosh Chodesh Adar": "Start of month of Adar on the Hebrew calendar. Adar (אַדָר) is the 12th month of the Hebrew year, has 29 days, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon",
|
|
660
|
-
"Rosh Chodesh Adar I": "Start of month of Adar I (on leap years) on the Hebrew calendar. Adar I (אַדָר א׳) is the 12th month of the Hebrew year, occurs only on leap years, has 30 days, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon",
|
|
661
|
-
"Rosh Chodesh Adar II": "Start of month of Adar II (on leap years) on the Hebrew calendar. Adar II (אַדָר ב׳), sometimes \"Adar Bet\" or \"Adar Sheni\", is the 13th month of the Hebrew year, has 29 days, occurs only on leap years, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon",
|
|
662
|
-
"Rosh Hashana": "The Jewish New Year. Also spelled Rosh Hashanah",
|
|
663
|
-
"Rosh Hashana LaBehemot": "New Year for Tithing Animals",
|
|
664
|
-
"Shabbat Chazon": "Shabbat of Prophecy/Shabbat of Vision. Shabbat before Tish'a B'Av",
|
|
665
|
-
"Shabbat HaChodesh": "Shabbat before Rosh Chodesh Nissan. Read in preparation for Passover",
|
|
666
|
-
"Shabbat HaGadol": "Shabbat before Pesach (The Great Shabbat)",
|
|
667
|
-
"Shabbat Machar Chodesh": "When Shabbat falls the day before Rosh Chodesh",
|
|
668
|
-
"Shabbat Mevarchim Chodesh": "Shabbat that precedes Rosh Chodesh. The congregation blesses the forthcoming new month",
|
|
669
|
-
"Shabbat Nachamu": "Shabbat after Tish'a B'Av (Shabbat of Consolation). The first of seven Shabbatot leading up to Rosh Hashanah. Named after the Haftarah (from Isaiah 40) which begins with the verse נַחֲמוּ נַחֲמוּ, עַמִּי (\"Comfort, oh comfort my people\")",
|
|
670
|
-
"Shabbat Parah": "Shabbat of the Red Heifer. Shabbat before Shabbat HaChodesh, in preparation for Passover",
|
|
671
|
-
"Shabbat Rosh Chodesh": "When Shabbat falls on Rosh Chodesh",
|
|
672
|
-
"Shabbat Shekalim": "Shabbat before Rosh Chodesh Adar. Read in preparation for Purim",
|
|
673
|
-
"Shabbat Shirah": "Shabbat of Song. Shabbat that includes Parashat Beshalach",
|
|
674
|
-
"Shabbat Shuva": "Shabbat of Returning. Shabbat that occurs during the Ten Days of Repentance between Rosh Hashanah and Yom Kippur",
|
|
675
|
-
"Shabbat Zachor": "Shabbat of Remembrance. Shabbat before Purim",
|
|
676
|
-
"Shavuot": "Festival of Weeks. Commemorates the giving of the Torah at Mount Sinai",
|
|
677
|
-
"Shmini Atzeret": "Eighth Day of Assembly. Immediately following Sukkot, it is observed as a separate holiday in the Diaspora and is combined with Simchat Torah in Israel",
|
|
678
|
-
"Shushan Purim": "Purim celebrated in Jerusalem and walled cities",
|
|
679
|
-
"Shushan Purim Katan": "Minor Purim celebration during Adar I on leap years in Jerusalem and walled cities",
|
|
680
|
-
"Sigd": "Ethiopian Jewish holiday occurring 50 days after Yom Kippur",
|
|
681
|
-
"Simchat Torah": "Day of Celebrating the Torah. Celebration marking the conclusion of the annual cycle of public Torah readings, and the beginning of a new cycle",
|
|
682
|
-
"Sukkot": "Feast of Booths. Also called the Feast of Tabernacles, the seven-day holiday is one of the Three Pilgrimage Festivals (Hebrew: שלוש רגלים, shalosh regalim)",
|
|
683
|
-
"Ta'anit Bechorot": "Fast of the First Born",
|
|
684
|
-
"Ta'anit Esther": "Fast of Esther",
|
|
685
|
-
"Tish'a B'Av": "The Ninth of Av. Fast commemorating the destruction of the two Temples",
|
|
686
|
-
"Tu B'Av": "Minor Jewish holiday of love. Observed on the 15th day of the Hebrew month of Av",
|
|
687
|
-
"Tu BiShvat": "New Year for Trees. Tu BiShvat is one of four “New Years” mentioned in the Mishnah",
|
|
688
|
-
"Tzom Gedaliah": "Fast of the Seventh Month. Commemorates the assassination of the Jewish governor of Judah",
|
|
689
|
-
"Tzom Tammuz": "Fast commemorating breaching of the walls of Jerusalem before the destruction of the Second Temple",
|
|
690
|
-
"Yitzhak Rabin Memorial Day": "Commemorates the life of Israeli Prime Minister Yitzhak Rabin",
|
|
691
|
-
"Yom HaAliyah": "Recognizes Aliyah, immigration to the Jewish State of Israel",
|
|
692
|
-
"Yom HaAliyah School Observance": "Aliyah Day observed in Israeli schools",
|
|
693
|
-
"Yom HaAtzma'ut": "Israeli Independence Day. Commemorates the declaration of independence of Israel in 1948. Although Yom HaAtzma'ut is normally observed on the 5th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaZikaron, which always precedes it) would conflict with Shabbat",
|
|
694
|
-
"Yom HaShoah": "Holocaust Memorial Day",
|
|
695
|
-
"Yom HaZikaron": "Israeli Memorial Day. Remembers those who died in the War of Independence and other wars in Israel. The full name of the holiday is Yom HaZikaron LeHalalei Ma'arakhot Yisrael ul'Nifge'ei Pe'ulot HaEivah (Hebrew: יוֹם הזִּכָּרוֹן לְחַלְלֵי מַעֲרָכוֹת יִשְׂרָאֵל וּלְנִפְגְעֵי פְּעֻלּוֹת הָאֵיבָה), Memorial Day for the Fallen Soldiers of the Wars of Israel and Victims of Actions of Terrorism. Although Yom Hazikaron is normally observed on the 4th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaAtzma'ut, which always follows it) would conflict with Shabbat",
|
|
696
|
-
"Yom Kippur": "Day of Atonement. The holiest day of the year in Judaism, traditionally observed with a 25-hour period of fasting and intensive prayer",
|
|
697
|
-
"Yom Kippur Katan": "Minor day of atonement occurring monthly on the day preceeding each Rosh Chodesh",
|
|
698
|
-
"Yom Yerushalayim": "Jerusalem Day. Commemorates the re-unification of Jerusalem in 1967"
|
|
699
|
-
};
|
|
7
|
+
const Chanukah="Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights, the eight-day festival is observed by lighting the candles of a hanukkiah (menorah)";const Pesach="Passover, the Feast of Unleavened Bread. Also called Chag HaMatzot (the Festival of Matzah), it commemorates the Exodus and freedom of the Israelites from ancient Egypt";const Purim="Celebration of Jewish deliverance as told by Megilat Esther. It commemorates a time when the Jewish people living in Persia were saved from extermination";const Shavuot="Festival of Weeks. Commemorates the giving of the Torah at Mount Sinai";const Sigd="Ethiopian Jewish holiday occurring 50 days after Yom Kippur";const Sukkot="Feast of Booths. Also called the Feast of Tabernacles, the seven-day holiday is one of the Three Pilgrimage Festivals (Hebrew: שלוש רגלים, shalosh regalim)";var holidayDescription0 = {"Asara B'Tevet":"Fast commemorating the siege of Jerusalem","Ben-Gurion Day":"Commemorates the life and vision of Israel's first Prime Minister David Ben-Gurion","Birkat Hachamah":"A rare Jewish blessing recited once every 28 years thanking G-d for creating the sun","Chag HaBanot":"North African Chanukah festival of daughters. Called Eid al-Banat in Arabic, the holiday was most preserved in Tunisia",Chanukah:Chanukah,"Days of the Omer":"7 weeks from the second night of Pesach to the day before Shavuot. Also called Sefirat HaOmer, it is a practice that consists of a verbal counting of each of the forty-nine days between the two holidays","Family Day":"Yom HaMishpacha, a day to honor the family unit","Hebrew Language Day":"Promotes the Hebrew language in Israel and around the world. Occurs on the birthday of Eliezer Ben Yehuda, the father of modern spoken Hebrew","Herzl Day":"Commemorates the life and vision of Zionist leader Theodor Herzl","Jabotinsky Day":"Commemorates the life and vision of Zionist leader Ze'ev Jabotinsky","Lag BaOmer":"33rd day of counting the Omer. The holiday is a temporary break from the semi-mourning period the counting of the Omer. Practices include lighting bonfires, getting haircuts, and Jewish weddings","Leil Selichot":"Prayers for forgiveness in preparation for the High Holidays","Pesach Sheni":"Second Passover, one month after Passover",Pesach:Pesach,"Purim Katan":"Minor Purim celebration during Adar I on leap years",Purim:Purim,"Purim Meshulash":"Triple Purim, spanning 3 days in Jerusalem and walled cities. It occurs when the 15th of Adar coincides with Shabbat","Rosh Chodesh Nisan":"Start of month of Nisan on the Hebrew calendar. נִיסָן (transliterated Nisan or Nissan) is the 1st month of the Hebrew year, has 30 days, and corresponds to March or April on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Iyyar":"Start of month of Iyyar on the Hebrew calendar. אִיָיר (transliterated Iyyar or Iyar) is the 2nd month of the Hebrew year, has 29 days, and corresponds to April or May on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sivan":"Start of month of Sivan on the Hebrew calendar. Sivan (סִיוָן) is the 3rd month of the Hebrew year, has 30 days, and corresponds to May or June on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tamuz":"Start of month of Tamuz on the Hebrew calendar. תַּמּוּז (transliterated Tamuz or Tammuz) is the 4th month of the Hebrew year, has 29 days, and corresponds to June or July on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Av":"Start of month of Av on the Hebrew calendar. Av (אָב) is the 5th month of the Hebrew year, has 30 days, and corresponds to July or August on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Elul":"Start of month of Elul on the Hebrew calendar. Elul (אֱלוּל) is the 6th month of the Hebrew year, has 29 days, and corresponds to August or September on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Cheshvan":"Start of month of Cheshvan on the Hebrew calendar. חֶשְׁוָן (transliterated Cheshvan or Heshvan) is the 8th month of the Hebrew year, has 29 or 30 days, and corresponds to October or November on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Kislev":"Start of month of Kislev on the Hebrew calendar. Kislev (כִּסְלֵו) is the 9th month of the Hebrew year, has 30 or 29 days, and corresponds to November or December on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tevet":"Start of month of Tevet on the Hebrew calendar. Tevet (טֵבֵת) is the 10th month of the Hebrew year, has 29 days, and corresponds to December or January on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sh'vat":"Start of month of Sh'vat on the Hebrew calendar. שְׁבָט (transliterated Sh'vat or Shevat) is the 11th month of the Hebrew year, has 30 days, and corresponds to January or February on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar":"Start of month of Adar on the Hebrew calendar. Adar (אַדָר) is the 12th month of the Hebrew year, has 29 days, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar I":"Start of month of Adar I (on leap years) on the Hebrew calendar. Adar I (אַדָר א׳) is the 12th month of the Hebrew year, occurs only on leap years, has 30 days, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar II":"Start of month of Adar II (on leap years) on the Hebrew calendar. Adar II (אַדָר ב׳), sometimes \"Adar Bet\" or \"Adar Sheni\", is the 13th month of the Hebrew year, has 29 days, occurs only on leap years, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Hashana":"The Jewish New Year. Also spelled Rosh Hashanah","Rosh Hashana LaBehemot":"New Year for Tithing Animals","Shabbat Chazon":"Shabbat of Prophecy/Shabbat of Vision. Shabbat before Tish'a B'Av","Shabbat HaChodesh":"Shabbat before Rosh Chodesh Nissan. Read in preparation for Passover","Shabbat HaGadol":"Shabbat before Pesach (The Great Shabbat)","Shabbat Machar Chodesh":"When Shabbat falls the day before Rosh Chodesh","Shabbat Mevarchim Chodesh":"Shabbat that precedes Rosh Chodesh. The congregation blesses the forthcoming new month","Shabbat Nachamu":"Shabbat after Tish'a B'Av (Shabbat of Consolation). The first of seven Shabbatot leading up to Rosh Hashanah. Named after the Haftarah (from Isaiah 40) which begins with the verse נַחֲמוּ נַחֲמוּ, עַמִּי (\"Comfort, oh comfort my people\")","Shabbat Parah":"Shabbat of the Red Heifer. Shabbat before Shabbat HaChodesh, in preparation for Passover","Shabbat Rosh Chodesh":"When Shabbat falls on Rosh Chodesh","Shabbat Shekalim":"Shabbat before Rosh Chodesh Adar. Read in preparation for Purim","Shabbat Shirah":"Shabbat of Song. Shabbat that includes Parashat Beshalach","Shabbat Shuva":"Shabbat of Returning. Shabbat that occurs during the Ten Days of Repentance between Rosh Hashanah and Yom Kippur","Shabbat Zachor":"Shabbat of Remembrance. Shabbat before Purim",Shavuot:Shavuot,"Shmini Atzeret":"Eighth Day of Assembly. Immediately following Sukkot, it is observed as a separate holiday in the Diaspora and is combined with Simchat Torah in Israel","Shushan Purim":"Purim celebrated in Jerusalem and walled cities","Shushan Purim Katan":"Minor Purim celebration during Adar I on leap years in Jerusalem and walled cities",Sigd:Sigd,"Simchat Torah":"Day of Celebrating the Torah. Celebration marking the conclusion of the annual cycle of public Torah readings, and the beginning of a new cycle",Sukkot:Sukkot,"Ta'anit Bechorot":"Fast of the First Born","Ta'anit Esther":"Fast of Esther","Tish'a B'Av":"The Ninth of Av. Fast commemorating the destruction of the two Temples","Tu B'Av":"Minor Jewish holiday of love. Observed on the 15th day of the Hebrew month of Av","Tu BiShvat":"New Year for Trees. Tu BiShvat is one of four “New Years” mentioned in the Mishnah","Tzom Gedaliah":"Fast of the Seventh Month. Commemorates the assassination of the Jewish governor of Judah","Tzom Tammuz":"Fast commemorating breaching of the walls of Jerusalem before the destruction of the Second Temple","Yitzhak Rabin Memorial Day":"Commemorates the life of Israeli Prime Minister Yitzhak Rabin","Yom HaAliyah":"Recognizes Aliyah, immigration to the Jewish State of Israel","Yom HaAliyah School Observance":"Aliyah Day observed in Israeli schools","Yom HaAtzma'ut":"Israeli Independence Day. Commemorates the declaration of independence of Israel in 1948. Although Yom HaAtzma'ut is normally observed on the 5th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaZikaron, which always precedes it) would conflict with Shabbat","Yom HaShoah":"Holocaust Memorial Day","Yom HaZikaron":"Israeli Memorial Day. Remembers those who died in the War of Independence and other wars in Israel. The full name of the holiday is Yom HaZikaron LeHalalei Ma'arakhot Yisrael ul'Nifge'ei Pe'ulot HaEivah (Hebrew: יוֹם הזִּכָּרוֹן לְחַלְלֵי מַעֲרָכוֹת יִשְׂרָאֵל וּלְנִפְגְעֵי פְּעֻלּוֹת הָאֵיבָה), Memorial Day for the Fallen Soldiers of the Wars of Israel and Victims of Actions of Terrorism. Although Yom Hazikaron is normally observed on the 4th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaAtzma'ut, which always follows it) would conflict with Shabbat","Yom Kippur":"Day of Atonement. The holiest day of the year in Judaism, traditionally observed with a 25-hour period of fasting and intensive prayer","Yom Kippur Katan":"Minor day of atonement occurring monthly on the day preceeding each Rosh Chodesh","Yom Yerushalayim":"Jerusalem Day. Commemorates the re-unification of Jerusalem in 1967"};
|
|
700
8
|
|
|
701
9
|
/**
|
|
702
10
|
* Helper function to transform a string to make it more usable in a URL or filename.
|
|
@@ -715,8 +23,8 @@ function makeAnchor(s) {
|
|
|
715
23
|
}
|
|
716
24
|
|
|
717
25
|
const parsha2id = new Map();
|
|
718
|
-
for (let id = 0; id <
|
|
719
|
-
const name =
|
|
26
|
+
for (let id = 0; id < sedra.parshiot.length; id++) {
|
|
27
|
+
const name = sedra.parshiot[id];
|
|
720
28
|
parsha2id.set(makeAnchor(name), id + 1);
|
|
721
29
|
}
|
|
722
30
|
const doubledParshiyot = [
|
|
@@ -757,7 +65,7 @@ function shortenSedrotUrl(u) {
|
|
|
757
65
|
const id = parsha2id.get(name);
|
|
758
66
|
if (id && dateStr.length === 8) {
|
|
759
67
|
const dt = parse8digitDateStr(dateStr);
|
|
760
|
-
const hd = new
|
|
68
|
+
const hd = new hdate.HDate(dt);
|
|
761
69
|
let p = '/s/' + hd.getFullYear();
|
|
762
70
|
if (u.searchParams.get('i') === 'on') {
|
|
763
71
|
p += 'i';
|
|
@@ -829,8 +137,8 @@ function getDownloadFilename(options) {
|
|
|
829
137
|
}
|
|
830
138
|
else if (typeof options.start === 'object' &&
|
|
831
139
|
typeof options.end === 'object') {
|
|
832
|
-
const start = new
|
|
833
|
-
const end = new
|
|
140
|
+
const start = new hdate.HDate(options.start);
|
|
141
|
+
const end = new hdate.HDate(options.end);
|
|
834
142
|
const y1 = start.greg().getFullYear();
|
|
835
143
|
const y2 = end.greg().getFullYear();
|
|
836
144
|
if (y1 === y2) {
|
|
@@ -853,7 +161,7 @@ function getDownloadFilename(options) {
|
|
|
853
161
|
* Returns just the date portion as YYYY-MM-DD
|
|
854
162
|
*/
|
|
855
163
|
function toISOString(d) {
|
|
856
|
-
return isoDateString(d);
|
|
164
|
+
return hdate.isoDateString(d);
|
|
857
165
|
}
|
|
858
166
|
/**
|
|
859
167
|
* Returns a category and subcategory name
|
|
@@ -932,7 +240,7 @@ function getCalendarTitle(events, options) {
|
|
|
932
240
|
* Returns an English language description of the holiday
|
|
933
241
|
*/
|
|
934
242
|
function getHolidayDescription(ev, firstSentence = false) {
|
|
935
|
-
const str0 = ev.getFlags() &
|
|
243
|
+
const str0 = ev.getFlags() & event.flags.SHABBAT_MEVARCHIM
|
|
936
244
|
? holidayDescription['Shabbat Mevarchim Chodesh']
|
|
937
245
|
: holidayDescription[ev.getDesc()] ||
|
|
938
246
|
holidayDescription[ev.basename()] ||
|
|
@@ -946,15 +254,15 @@ function getHolidayDescription(ev, firstSentence = false) {
|
|
|
946
254
|
}
|
|
947
255
|
return str;
|
|
948
256
|
}
|
|
949
|
-
const HOLIDAY_IGNORE_MASK =
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
257
|
+
const HOLIDAY_IGNORE_MASK = event.flags.DAF_YOMI |
|
|
258
|
+
event.flags.OMER_COUNT |
|
|
259
|
+
event.flags.SHABBAT_MEVARCHIM |
|
|
260
|
+
event.flags.MOLAD |
|
|
261
|
+
event.flags.USER_EVENT |
|
|
262
|
+
event.flags.NACH_YOMI |
|
|
263
|
+
event.flags.DAILY_LEARNING |
|
|
264
|
+
event.flags.HEBREW_DATE |
|
|
265
|
+
event.flags.YERUSHALMI_YOMI;
|
|
958
266
|
/**
|
|
959
267
|
* Makes mulit-line text that summarizes Torah & Haftarah
|
|
960
268
|
*/
|
|
@@ -965,9 +273,9 @@ function makeTorahMemoText(ev, il) {
|
|
|
965
273
|
typeof ev.eventTime !== 'undefined') {
|
|
966
274
|
return '';
|
|
967
275
|
}
|
|
968
|
-
const reading = mask &
|
|
276
|
+
const reading = mask & event.flags.PARSHA_HASHAVUA
|
|
969
277
|
? leyning.getLeyningForParshaHaShavua(ev, il)
|
|
970
|
-
:
|
|
278
|
+
: getLeyningForHoliday.getLeyningForHoliday(ev, il);
|
|
971
279
|
let memo = '';
|
|
972
280
|
if (reading && (reading.summary || reading.haftara)) {
|
|
973
281
|
if (reading.summary) {
|
|
@@ -989,7 +297,7 @@ function makeTorahMemoText(ev, il) {
|
|
|
989
297
|
return memo;
|
|
990
298
|
}
|
|
991
299
|
function makeMemo(ev, il) {
|
|
992
|
-
if (ev.getFlags() &
|
|
300
|
+
if (ev.getFlags() & event.flags.PARSHA_HASHAVUA) {
|
|
993
301
|
try {
|
|
994
302
|
const memo = makeTorahMemoText(ev, il);
|
|
995
303
|
if (memo) {
|
|
@@ -1063,19 +371,19 @@ function shouldRenderBrief(ev) {
|
|
|
1063
371
|
return true;
|
|
1064
372
|
}
|
|
1065
373
|
const mask = ev.getFlags();
|
|
1066
|
-
if (mask &
|
|
374
|
+
if (mask & event.flags.HEBREW_DATE) {
|
|
1067
375
|
const hd = ev.getDate();
|
|
1068
376
|
return hd.getDate() === 1 ? false : true;
|
|
1069
377
|
}
|
|
1070
378
|
else if (mask &
|
|
1071
|
-
(
|
|
379
|
+
(event.flags.DAILY_LEARNING | event.flags.DAF_YOMI | event.flags.YERUSHALMI_YOMI)) {
|
|
1072
380
|
return true;
|
|
1073
381
|
}
|
|
1074
|
-
else if (mask &
|
|
382
|
+
else if (mask & event.flags.MINOR_FAST &&
|
|
1075
383
|
ev.getDesc().substring(0, 16) === 'Yom Kippur Katan') {
|
|
1076
384
|
return true;
|
|
1077
385
|
}
|
|
1078
|
-
else if (mask &
|
|
386
|
+
else if (mask & event.flags.SHABBAT_MEVARCHIM) {
|
|
1079
387
|
return true;
|
|
1080
388
|
}
|
|
1081
389
|
else {
|
|
@@ -1121,7 +429,7 @@ function eventToCsv(ev, options) {
|
|
|
1121
429
|
? ev.renderBrief(options.locale)
|
|
1122
430
|
: ev.render(options.locale);
|
|
1123
431
|
if (timed) {
|
|
1124
|
-
const timeStr =
|
|
432
|
+
const timeStr = reformatTimeStr.reformatTimeStr(timedEv.eventTimeStr, ' PM', options);
|
|
1125
433
|
endTime = startTime = `"${timeStr}"`;
|
|
1126
434
|
endDate = date;
|
|
1127
435
|
allDay = '"false"';
|
|
@@ -1155,7 +463,7 @@ function eventToCsv(ev, options) {
|
|
|
1155
463
|
.replace(/,/g, ';')
|
|
1156
464
|
.replace(/"/g, "''")
|
|
1157
465
|
.replace(/\n/g, ' / ');
|
|
1158
|
-
const showTimeAs = timed || mask &
|
|
466
|
+
const showTimeAs = timed || mask & event.flags.CHAG ? 4 : 3;
|
|
1159
467
|
return `"${subj}",${date},${startTime},${endDate},${endTime},${allDay},"${memo}","${showTimeAs}","${loc}"`;
|
|
1160
468
|
}
|
|
1161
469
|
function eventsToCsv(events, options) {
|
|
@@ -1164,16 +472,21 @@ function eventsToCsv(events, options) {
|
|
|
1164
472
|
}
|
|
1165
473
|
|
|
1166
474
|
function eventIsoDate(ev) {
|
|
1167
|
-
return isoDateString(ev.getDate().greg());
|
|
475
|
+
return hdate.isoDateString(ev.getDate().greg());
|
|
1168
476
|
}
|
|
1169
477
|
/**
|
|
1170
478
|
* Formats a list events for the classic Hebcal.com JSON API response
|
|
1171
479
|
*/
|
|
1172
480
|
function eventsToClassicApi(events, options, leyning = true) {
|
|
481
|
+
const result = eventsToClassicApiHeader(events, options);
|
|
482
|
+
result.items = events.map(ev => eventToClassicApiObject(ev, options, leyning));
|
|
483
|
+
return result;
|
|
484
|
+
}
|
|
485
|
+
function eventsToClassicApiHeader(events, options) {
|
|
1173
486
|
const result = {
|
|
1174
487
|
title: getCalendarTitle(events, options),
|
|
1175
488
|
date: new Date().toISOString(),
|
|
1176
|
-
version:
|
|
489
|
+
version: pkgVersion.version,
|
|
1177
490
|
};
|
|
1178
491
|
result.location = locationToPlainObj(options.location);
|
|
1179
492
|
if (events.length) {
|
|
@@ -1182,7 +495,6 @@ function eventsToClassicApi(events, options, leyning = true) {
|
|
|
1182
495
|
end: eventIsoDate(events[events.length - 1]),
|
|
1183
496
|
};
|
|
1184
497
|
}
|
|
1185
|
-
result.items = events.map(ev => eventToClassicApiObject(ev, options, leyning));
|
|
1186
498
|
return result;
|
|
1187
499
|
}
|
|
1188
500
|
/**
|
|
@@ -1196,8 +508,8 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
|
|
|
1196
508
|
const dt = hd.greg();
|
|
1197
509
|
const tzid = typeof options.location === 'object' ? options.location.getTzid() : 'UTC';
|
|
1198
510
|
const date = timed
|
|
1199
|
-
?
|
|
1200
|
-
: isoDateString(dt);
|
|
511
|
+
? zmanim.Zmanim.formatISOWithTimeZone(tzid, eventTime)
|
|
512
|
+
: hdate.isoDateString(dt);
|
|
1201
513
|
const categories = getEventCategories(ev);
|
|
1202
514
|
const mask = ev.getFlags();
|
|
1203
515
|
let title = shouldRenderBrief(ev)
|
|
@@ -1206,7 +518,7 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
|
|
|
1206
518
|
const desc = ev.getDesc();
|
|
1207
519
|
const candles = desc === 'Havdalah' || desc === 'Candle lighting';
|
|
1208
520
|
if (candles) {
|
|
1209
|
-
const time =
|
|
521
|
+
const time = reformatTimeStr.reformatTimeStr(timedEv.eventTimeStr, 'pm', options);
|
|
1210
522
|
title += ': ' + time;
|
|
1211
523
|
}
|
|
1212
524
|
const result = {
|
|
@@ -1220,7 +532,7 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
|
|
|
1220
532
|
if (categories.length > 1) {
|
|
1221
533
|
result.subcat = categories[1];
|
|
1222
534
|
}
|
|
1223
|
-
if (categories[0] === 'holiday' && mask &
|
|
535
|
+
if (categories[0] === 'holiday' && mask & event.flags.CHAG) {
|
|
1224
536
|
result.yomtov = true;
|
|
1225
537
|
}
|
|
1226
538
|
if (title !== desc) {
|
|
@@ -1228,24 +540,17 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
|
|
|
1228
540
|
}
|
|
1229
541
|
const hebrew = ev.renderBrief('he');
|
|
1230
542
|
if (hebrew) {
|
|
1231
|
-
result.hebrew =
|
|
543
|
+
result.hebrew = locale.Locale.hebrewStripNikkud(hebrew);
|
|
1232
544
|
}
|
|
1233
545
|
if (!candles) {
|
|
1234
546
|
if (leyning$1) {
|
|
1235
547
|
const il = options.il;
|
|
1236
|
-
const isParsha = mask ===
|
|
548
|
+
const isParsha = mask === event.flags.PARSHA_HASHAVUA;
|
|
1237
549
|
const reading = isParsha
|
|
1238
550
|
? leyning.getLeyningForParshaHaShavua(ev, il)
|
|
1239
|
-
:
|
|
551
|
+
: getLeyningForHoliday.getLeyningForHoliday(ev, il);
|
|
1240
552
|
if (reading) {
|
|
1241
553
|
result.leyning = formatLeyningResult(reading);
|
|
1242
|
-
const hyear = hd.getFullYear();
|
|
1243
|
-
if (isParsha && hyear >= 5745) {
|
|
1244
|
-
const triReading = triennial.getTriennialForParshaHaShavua(ev, il);
|
|
1245
|
-
if (triReading === null || triReading === void 0 ? void 0 : triReading.aliyot) {
|
|
1246
|
-
result.leyning.triennial = formatAliyot({}, triReading.aliyot);
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
554
|
}
|
|
1250
555
|
}
|
|
1251
556
|
const url = ev.url();
|
|
@@ -1256,7 +561,7 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
|
|
|
1256
561
|
result.link = appendIsraelAndTracking(url, Boolean(options.il), utmSource, utmMedium, utmCampaign);
|
|
1257
562
|
}
|
|
1258
563
|
}
|
|
1259
|
-
if (mask &
|
|
564
|
+
if (mask & event.flags.OMER_COUNT) {
|
|
1260
565
|
const omerEv = ev;
|
|
1261
566
|
result.omer = {
|
|
1262
567
|
count: {
|
|
@@ -1270,13 +575,13 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
|
|
|
1270
575
|
},
|
|
1271
576
|
};
|
|
1272
577
|
}
|
|
1273
|
-
if (mask &
|
|
578
|
+
if (mask & event.flags.MOLAD) {
|
|
1274
579
|
const moladEv = ev;
|
|
1275
580
|
const m = moladEv.molad;
|
|
1276
581
|
const hy = m.getYear();
|
|
1277
582
|
result.molad = {
|
|
1278
583
|
hy,
|
|
1279
|
-
hm:
|
|
584
|
+
hm: hdate.HDate.getMonthName(m.getMonth(), hy),
|
|
1280
585
|
dow: m.getDow(),
|
|
1281
586
|
hour: m.getHour(),
|
|
1282
587
|
minutes: m.getMinutes(),
|
|
@@ -1284,14 +589,14 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
|
|
|
1284
589
|
};
|
|
1285
590
|
delete result.hebrew;
|
|
1286
591
|
}
|
|
1287
|
-
if ((options.heDateParts && !timed) || mask &
|
|
592
|
+
if ((options.heDateParts && !timed) || mask & event.flags.HEBREW_DATE) {
|
|
1288
593
|
const yy = hd.getFullYear();
|
|
1289
594
|
const mm = hd.getMonthName();
|
|
1290
595
|
const dd = hd.getDate();
|
|
1291
596
|
result.heDateParts = {
|
|
1292
|
-
y:
|
|
1293
|
-
m:
|
|
1294
|
-
d:
|
|
597
|
+
y: hdate.gematriya(yy),
|
|
598
|
+
m: locale.Locale.gettext(mm, 'he-x-NoNikud'),
|
|
599
|
+
d: hdate.gematriya(dd),
|
|
1295
600
|
};
|
|
1296
601
|
}
|
|
1297
602
|
const memo = ev.memo || getHolidayDescription(ev);
|
|
@@ -1310,7 +615,7 @@ function formatAliyot(result, aliyot) {
|
|
|
1310
615
|
for (const [num, aliyah] of Object.entries(aliyot)) {
|
|
1311
616
|
if (typeof aliyah !== 'undefined') {
|
|
1312
617
|
const k = num === 'M' ? 'maftir' : num;
|
|
1313
|
-
result[k] =
|
|
618
|
+
result[k] = common.formatAliyahWithBook(aliyah);
|
|
1314
619
|
}
|
|
1315
620
|
}
|
|
1316
621
|
return result;
|
|
@@ -1352,7 +657,7 @@ function getLinkAndGuid(ev, il, tzid, mainUrl, utmSource, utmMedium) {
|
|
|
1352
657
|
let guid;
|
|
1353
658
|
const eventTime = ev.eventTime;
|
|
1354
659
|
const dt = eventTime || ev.getDate().greg();
|
|
1355
|
-
const isoDateTime =
|
|
660
|
+
const isoDateTime = zmanim.Zmanim.formatISOWithTimeZone(tzid, dt);
|
|
1356
661
|
const dtStr = isoDateTime.substring(0, isoDateTime.indexOf('T'));
|
|
1357
662
|
const dtAnchor = dtStr.replace(/-/g, '');
|
|
1358
663
|
const descAnchor = makeAnchor(ev.getDesc());
|
|
@@ -1447,8 +752,8 @@ function eventToRssItem2(ev, options) {
|
|
|
1447
752
|
if (candles) {
|
|
1448
753
|
const colon = subj.indexOf(': ');
|
|
1449
754
|
if (colon !== -1) {
|
|
1450
|
-
const options = { location, il, locale:
|
|
1451
|
-
const time =
|
|
755
|
+
const options = { location, il, locale: locale.Locale.getLocaleName() };
|
|
756
|
+
const time = reformatTimeStr.reformatTimeStr(ev.eventTimeStr, 'pm', options);
|
|
1452
757
|
subj = subj.substring(0, colon) + ': ' + time;
|
|
1453
758
|
}
|
|
1454
759
|
}
|
|
@@ -1478,7 +783,7 @@ ${geoTags}</item>
|
|
|
1478
783
|
function eventToFullCalendar(ev, tzid, il) {
|
|
1479
784
|
const classes = getEventCategories(ev);
|
|
1480
785
|
const mask = ev.getFlags();
|
|
1481
|
-
if (classes[0] === 'holiday' && mask &
|
|
786
|
+
if (classes[0] === 'holiday' && mask & event.flags.CHAG) {
|
|
1482
787
|
classes.push('yomtov');
|
|
1483
788
|
}
|
|
1484
789
|
const timedEv = ev;
|
|
@@ -1486,8 +791,8 @@ function eventToFullCalendar(ev, tzid, il) {
|
|
|
1486
791
|
const timed = Boolean(eventTime);
|
|
1487
792
|
const title = shouldRenderBrief(ev) ? ev.renderBrief() : ev.render();
|
|
1488
793
|
const start = timed
|
|
1489
|
-
?
|
|
1490
|
-
: isoDateString(ev.getDate().greg());
|
|
794
|
+
? zmanim.Zmanim.formatISOWithTimeZone(tzid, eventTime)
|
|
795
|
+
: hdate.isoDateString(ev.getDate().greg());
|
|
1491
796
|
const result = {
|
|
1492
797
|
title,
|
|
1493
798
|
start,
|
|
@@ -1496,7 +801,7 @@ function eventToFullCalendar(ev, tzid, il) {
|
|
|
1496
801
|
};
|
|
1497
802
|
const hebrew = ev.renderBrief('he');
|
|
1498
803
|
if (hebrew) {
|
|
1499
|
-
result.hebrew =
|
|
804
|
+
result.hebrew = locale.Locale.hebrewStripNikkud(hebrew);
|
|
1500
805
|
}
|
|
1501
806
|
const url = ev.url();
|
|
1502
807
|
if (url) {
|
|
@@ -1516,6 +821,14 @@ function eventToFullCalendar(ev, tzid, il) {
|
|
|
1516
821
|
return result;
|
|
1517
822
|
}
|
|
1518
823
|
|
|
824
|
+
Object.defineProperty(exports, "pad2", {
|
|
825
|
+
enumerable: true,
|
|
826
|
+
get: function () { return hdate.pad2; }
|
|
827
|
+
});
|
|
828
|
+
Object.defineProperty(exports, "pad4", {
|
|
829
|
+
enumerable: true,
|
|
830
|
+
get: function () { return hdate.pad4; }
|
|
831
|
+
});
|
|
1519
832
|
exports.appendIsraelAndTracking = appendIsraelAndTracking;
|
|
1520
833
|
exports.countryNames = countryNames;
|
|
1521
834
|
exports.eventToClassicApiObject = eventToClassicApiObject;
|
|
@@ -1523,6 +836,7 @@ exports.eventToCsv = eventToCsv;
|
|
|
1523
836
|
exports.eventToFullCalendar = eventToFullCalendar;
|
|
1524
837
|
exports.eventToRssItem2 = eventToRssItem2;
|
|
1525
838
|
exports.eventsToClassicApi = eventsToClassicApi;
|
|
839
|
+
exports.eventsToClassicApiHeader = eventsToClassicApiHeader;
|
|
1526
840
|
exports.eventsToCsv = eventsToCsv;
|
|
1527
841
|
exports.eventsToRss2 = eventsToRss2;
|
|
1528
842
|
exports.getCalendarTitle = getCalendarTitle;
|
|
@@ -1534,12 +848,10 @@ exports.locationToPlainObj = locationToPlainObj;
|
|
|
1534
848
|
exports.makeAnchor = makeAnchor;
|
|
1535
849
|
exports.makeMemo = makeMemo;
|
|
1536
850
|
exports.makeTorahMemoText = makeTorahMemoText;
|
|
1537
|
-
exports.pad2 = pad2;
|
|
1538
|
-
exports.pad4 = pad4;
|
|
1539
851
|
exports.renderTitleWithoutTime = renderTitleWithoutTime;
|
|
1540
852
|
exports.shouldRenderBrief = shouldRenderBrief;
|
|
1541
853
|
exports.toISOString = toISOString;
|
|
1542
854
|
|
|
1543
855
|
return exports;
|
|
1544
856
|
|
|
1545
|
-
})({}, hebcal, hebcal__leyning,
|
|
857
|
+
})({}, hebcal, hebcal, hebcal, hebcal__leyning, hebcal__leyning, hebcal, hebcal, hebcal, hebcal, hebcal__leyning);
|