@hebcal/core 3.33.4 → 3.33.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +250 -261
- package/dist/bundle.js +323 -255
- package/dist/bundle.min.js +2 -2
- package/dist/hdate-bundle.js +312 -244
- package/dist/hdate-bundle.min.js +2 -2
- package/dist/hdate.js +76 -61
- package/dist/hdate.mjs +76 -61
- package/dist/index.js +105 -70
- package/dist/index.mjs +87 -72
- package/hebcal.d.ts +116 -115
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v3.33.
|
|
1
|
+
/*! @hebcal/core v3.33.5 */
|
|
2
2
|
var hebcal = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -37,6 +37,21 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
37
37
|
return Constructor;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
function _defineProperty(obj, key, value) {
|
|
41
|
+
if (key in obj) {
|
|
42
|
+
Object.defineProperty(obj, key, {
|
|
43
|
+
value: value,
|
|
44
|
+
enumerable: true,
|
|
45
|
+
configurable: true,
|
|
46
|
+
writable: true
|
|
47
|
+
});
|
|
48
|
+
} else {
|
|
49
|
+
obj[key] = value;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return obj;
|
|
53
|
+
}
|
|
54
|
+
|
|
40
55
|
function _inherits(subClass, superClass) {
|
|
41
56
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
42
57
|
throw new TypeError("Super expression must either be null or a function");
|
|
@@ -238,148 +253,172 @@ function quotient(x, y) {
|
|
|
238
253
|
}
|
|
239
254
|
/**
|
|
240
255
|
* Gregorian date helper functions.
|
|
241
|
-
* @namespace
|
|
242
256
|
*/
|
|
243
257
|
|
|
244
258
|
|
|
245
|
-
var greg = {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
* @type {string[]}
|
|
250
|
-
*/
|
|
251
|
-
monthNames: ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
|
259
|
+
var greg = /*#__PURE__*/function () {
|
|
260
|
+
function greg() {
|
|
261
|
+
_classCallCheck(this, greg);
|
|
262
|
+
}
|
|
252
263
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
264
|
+
_createClass(greg, null, [{
|
|
265
|
+
key: "isLeapYear",
|
|
266
|
+
value:
|
|
267
|
+
/**
|
|
268
|
+
* Long names of the Gregorian months (1='January', 12='December')
|
|
269
|
+
* @readonly
|
|
270
|
+
* @type {string[]}
|
|
271
|
+
*/
|
|
261
272
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
273
|
+
/**
|
|
274
|
+
* Returns true if the Gregorian year is a leap year
|
|
275
|
+
* @param {number} year Gregorian year
|
|
276
|
+
* @return {boolean}
|
|
277
|
+
*/
|
|
278
|
+
function isLeapYear(year) {
|
|
279
|
+
return !(year % 4) && (!!(year % 100) || !(year % 400));
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Number of days in the Gregorian month for given year
|
|
283
|
+
* @param {number} month Gregorian month (1=January, 12=December)
|
|
284
|
+
* @param {number} year Gregorian year
|
|
285
|
+
* @return {number}
|
|
286
|
+
*/
|
|
272
287
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
288
|
+
}, {
|
|
289
|
+
key: "daysInMonth",
|
|
290
|
+
value: function daysInMonth(month, year) {
|
|
291
|
+
// 1 based months
|
|
292
|
+
return monthLengths[+this.isLeapYear(year)][month];
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Returns true if the object is a Javascript Date
|
|
296
|
+
* @param {Object} obj
|
|
297
|
+
* @return {boolean}
|
|
298
|
+
*/
|
|
281
299
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
*/
|
|
287
|
-
dayOfYear: function dayOfYear(date) {
|
|
288
|
-
if (!this.isDate(date)) {
|
|
289
|
-
throw new TypeError('Argument to greg.dayOfYear not a Date');
|
|
300
|
+
}, {
|
|
301
|
+
key: "isDate",
|
|
302
|
+
value: function isDate(obj) {
|
|
303
|
+
return _typeof(obj) === 'object' && Date.prototype === obj.__proto__;
|
|
290
304
|
}
|
|
305
|
+
/**
|
|
306
|
+
* Returns number of days since January 1 of that year
|
|
307
|
+
* @param {Date} date Gregorian date
|
|
308
|
+
* @return {number}
|
|
309
|
+
*/
|
|
291
310
|
|
|
292
|
-
|
|
311
|
+
}, {
|
|
312
|
+
key: "dayOfYear",
|
|
313
|
+
value: function dayOfYear(date) {
|
|
314
|
+
if (!this.isDate(date)) {
|
|
315
|
+
throw new TypeError('Argument to greg.dayOfYear not a Date');
|
|
316
|
+
}
|
|
293
317
|
|
|
294
|
-
|
|
295
|
-
// FEB
|
|
296
|
-
doy -= Math.floor((4 * (date.getMonth() + 1) + 23) / 10);
|
|
318
|
+
var doy = date.getDate() + 31 * date.getMonth();
|
|
297
319
|
|
|
298
|
-
if (
|
|
299
|
-
|
|
320
|
+
if (date.getMonth() > 1) {
|
|
321
|
+
// FEB
|
|
322
|
+
doy -= Math.floor((4 * (date.getMonth() + 1) + 23) / 10);
|
|
323
|
+
|
|
324
|
+
if (this.isLeapYear(date.getFullYear())) {
|
|
325
|
+
doy++;
|
|
326
|
+
}
|
|
300
327
|
}
|
|
328
|
+
|
|
329
|
+
return doy;
|
|
301
330
|
}
|
|
331
|
+
/**
|
|
332
|
+
* Converts Gregorian date to absolute R.D. (Rata Die) days
|
|
333
|
+
* @param {Date} date Gregorian date
|
|
334
|
+
* @return {number}
|
|
335
|
+
*/
|
|
302
336
|
|
|
303
|
-
|
|
304
|
-
|
|
337
|
+
}, {
|
|
338
|
+
key: "greg2abs",
|
|
339
|
+
value: function greg2abs(date) {
|
|
340
|
+
if (!this.isDate(date)) {
|
|
341
|
+
throw new TypeError('Argument to greg.greg2abs not a Date');
|
|
342
|
+
}
|
|
305
343
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
if (!this.isDate(date)) {
|
|
313
|
-
throw new TypeError('Argument to greg.greg2abs not a Date');
|
|
344
|
+
var year = date.getFullYear() - 1;
|
|
345
|
+
return this.dayOfYear(date) + // days this year
|
|
346
|
+
365 * year + ( // + days in prior years
|
|
347
|
+
Math.floor(year / 4) - // + Julian Leap years
|
|
348
|
+
Math.floor(year / 100) + // - century years
|
|
349
|
+
Math.floor(year / 400)); // + Gregorian leap years
|
|
314
350
|
}
|
|
351
|
+
/**
|
|
352
|
+
* @private
|
|
353
|
+
* @param {number} theDate - R.D. number of days
|
|
354
|
+
* @return {number}
|
|
355
|
+
*/
|
|
315
356
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
357
|
+
}, {
|
|
358
|
+
key: "yearFromFixed",
|
|
359
|
+
value: function yearFromFixed(theDate) {
|
|
360
|
+
var l0 = theDate - 1;
|
|
361
|
+
var n400 = quotient(l0, 146097);
|
|
362
|
+
var d1 = mod(l0, 146097);
|
|
363
|
+
var n100 = quotient(d1, 36524);
|
|
364
|
+
var d2 = mod(d1, 36524);
|
|
365
|
+
var n4 = quotient(d2, 1461);
|
|
366
|
+
var d3 = mod(d2, 1461);
|
|
367
|
+
var n1 = quotient(d3, 365);
|
|
368
|
+
var year = 400 * n400 + 100 * n100 + 4 * n4 + n1;
|
|
369
|
+
return n100 != 4 && n1 != 4 ? year + 1 : year;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* @private
|
|
373
|
+
* @param {number} year
|
|
374
|
+
* @param {number} month
|
|
375
|
+
* @param {number} day
|
|
376
|
+
* @return {number}
|
|
377
|
+
*/
|
|
323
378
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
return n100 != 4 && n1 != 4 ? year + 1 : year;
|
|
340
|
-
},
|
|
379
|
+
}, {
|
|
380
|
+
key: "toFixed",
|
|
381
|
+
value: function toFixed(year, month, day) {
|
|
382
|
+
var py = year - 1;
|
|
383
|
+
return 0 + 365 * py + quotient(py, 4) - quotient(py, 100) + quotient(py, 400) + quotient(367 * month - 362, 12) + Math.floor(month <= 2 ? 0 : this.isLeapYear(year) ? -1 : -2) + day;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Converts from Rata Die (R.D. number) to Gregorian date.
|
|
387
|
+
* See the footnote on page 384 of ``Calendrical Calculations, Part II:
|
|
388
|
+
* Three Historical Calendars'' by E. M. Reingold, N. Dershowitz, and S. M.
|
|
389
|
+
* Clamen, Software--Practice and Experience, Volume 23, Number 4
|
|
390
|
+
* (April, 1993), pages 383-404 for an explanation.
|
|
391
|
+
* @param {number} theDate - R.D. number of days
|
|
392
|
+
* @return {Date}
|
|
393
|
+
*/
|
|
341
394
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
*/
|
|
349
|
-
toFixed: function toFixed(year, month, day) {
|
|
350
|
-
var py = year - 1;
|
|
351
|
-
return 0 + 365 * py + quotient(py, 4) - quotient(py, 100) + quotient(py, 400) + quotient(367 * month - 362, 12) + Math.floor(month <= 2 ? 0 : this.isLeapYear(year) ? -1 : -2) + day;
|
|
352
|
-
},
|
|
395
|
+
}, {
|
|
396
|
+
key: "abs2greg",
|
|
397
|
+
value: function abs2greg(theDate) {
|
|
398
|
+
if (typeof theDate !== 'number') {
|
|
399
|
+
throw new TypeError('Argument to greg.abs2greg not a Number');
|
|
400
|
+
}
|
|
353
401
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
* @return {Date}
|
|
362
|
-
*/
|
|
363
|
-
abs2greg: function abs2greg(theDate) {
|
|
364
|
-
if (typeof theDate !== 'number') {
|
|
365
|
-
throw new TypeError('Argument to greg.abs2greg not a Number');
|
|
366
|
-
}
|
|
402
|
+
theDate = Math.trunc(theDate);
|
|
403
|
+
var year = this.yearFromFixed(theDate);
|
|
404
|
+
var priorDays = theDate - this.toFixed(year, 1, 1);
|
|
405
|
+
var correction = theDate < this.toFixed(year, 3, 1) ? 0 : this.isLeapYear(year) ? 1 : 2;
|
|
406
|
+
var month = quotient(12 * (priorDays + correction) + 373, 367);
|
|
407
|
+
var day = theDate - this.toFixed(year, month, 1) + 1;
|
|
408
|
+
var dt = new Date(year, month - 1, day);
|
|
367
409
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
var correction = theDate < this.toFixed(year, 3, 1) ? 0 : this.isLeapYear(year) ? 1 : 2;
|
|
372
|
-
var month = quotient(12 * (priorDays + correction) + 373, 367);
|
|
373
|
-
var day = theDate - this.toFixed(year, month, 1) + 1;
|
|
374
|
-
var dt = new Date(year, month - 1, day);
|
|
410
|
+
if (year < 100 && year >= 0) {
|
|
411
|
+
dt.setFullYear(year);
|
|
412
|
+
}
|
|
375
413
|
|
|
376
|
-
|
|
377
|
-
dt.setFullYear(year);
|
|
414
|
+
return dt;
|
|
378
415
|
}
|
|
416
|
+
}]);
|
|
379
417
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
418
|
+
return greg;
|
|
419
|
+
}();
|
|
420
|
+
|
|
421
|
+
_defineProperty(greg, "monthNames", ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']);
|
|
383
422
|
|
|
384
423
|
var GERESH = '׳';
|
|
385
424
|
var GERSHAYIM = '״';
|
|
@@ -1770,159 +1809,188 @@ var alias = {
|
|
|
1770
1809
|
* * `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
|
|
1771
1810
|
* * `he` - Hebrew (e.g. "שַׁבָּת")
|
|
1772
1811
|
* * `he-x-NoNikud` - Hebrew without nikud (e.g. "שבת")
|
|
1773
|
-
* @namespace
|
|
1774
1812
|
*/
|
|
1775
1813
|
|
|
1776
|
-
var Locale = {
|
|
1777
|
-
|
|
1778
|
-
|
|
1814
|
+
var Locale = /*#__PURE__*/function () {
|
|
1815
|
+
function Locale() {
|
|
1816
|
+
_classCallCheck(this, Locale);
|
|
1817
|
+
}
|
|
1779
1818
|
|
|
1780
|
-
|
|
1781
|
-
|
|
1819
|
+
_createClass(Locale, null, [{
|
|
1820
|
+
key: "lookupTranslation",
|
|
1821
|
+
value:
|
|
1822
|
+
/** @private */
|
|
1782
1823
|
|
|
1783
|
-
|
|
1784
|
-
activeName: null,
|
|
1824
|
+
/** @private */
|
|
1785
1825
|
|
|
1786
|
-
|
|
1787
|
-
* Returns translation only if `locale` offers a non-empty translation for `id`.
|
|
1788
|
-
* Otherwise, returns `undefined`.
|
|
1789
|
-
* @param {string} id Message ID to translate
|
|
1790
|
-
* @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
|
|
1791
|
-
* @return {string}
|
|
1792
|
-
*/
|
|
1793
|
-
lookupTranslation: function lookupTranslation(id, locale) {
|
|
1794
|
-
var locale0 = locale && locale.toLowerCase();
|
|
1795
|
-
var loc = typeof locale == 'string' && this.locales[locale0] || this.activeLocale;
|
|
1796
|
-
var array = loc[id];
|
|
1826
|
+
/** @private */
|
|
1797
1827
|
|
|
1798
|
-
|
|
1799
|
-
|
|
1828
|
+
/**
|
|
1829
|
+
* Returns translation only if `locale` offers a non-empty translation for `id`.
|
|
1830
|
+
* Otherwise, returns `undefined`.
|
|
1831
|
+
* @param {string} id Message ID to translate
|
|
1832
|
+
* @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
|
|
1833
|
+
* @return {string}
|
|
1834
|
+
*/
|
|
1835
|
+
function lookupTranslation(id, locale) {
|
|
1836
|
+
var locale0 = locale && locale.toLowerCase();
|
|
1837
|
+
var loc = typeof locale == 'string' && this.locales[locale0] || this.activeLocale;
|
|
1838
|
+
var array = loc[id];
|
|
1839
|
+
|
|
1840
|
+
if (array && array.length && array[0].length) {
|
|
1841
|
+
return array[0];
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
return undefined;
|
|
1800
1845
|
}
|
|
1846
|
+
/**
|
|
1847
|
+
* By default, if no translation was found, returns `id`.
|
|
1848
|
+
* @param {string} id Message ID to translate
|
|
1849
|
+
* @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
|
|
1850
|
+
* @return {string}
|
|
1851
|
+
*/
|
|
1801
1852
|
|
|
1802
|
-
|
|
1803
|
-
|
|
1853
|
+
}, {
|
|
1854
|
+
key: "gettext",
|
|
1855
|
+
value: function gettext(id, locale) {
|
|
1856
|
+
var text = this.lookupTranslation(id, locale);
|
|
1804
1857
|
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
* @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
|
|
1809
|
-
* @return {string}
|
|
1810
|
-
*/
|
|
1811
|
-
gettext: function gettext(id, locale) {
|
|
1812
|
-
var text = this.lookupTranslation(id, locale);
|
|
1858
|
+
if (typeof text == 'undefined') {
|
|
1859
|
+
return id;
|
|
1860
|
+
}
|
|
1813
1861
|
|
|
1814
|
-
|
|
1815
|
-
return id;
|
|
1862
|
+
return text;
|
|
1816
1863
|
}
|
|
1864
|
+
/**
|
|
1865
|
+
* Register locale translations.
|
|
1866
|
+
* @param {string} locale Locale name (i.e.: `'he'`, `'fr'`)
|
|
1867
|
+
* @param {LocaleDate} data parsed data from a `.po` file.
|
|
1868
|
+
*/
|
|
1817
1869
|
|
|
1818
|
-
|
|
1819
|
-
|
|
1870
|
+
}, {
|
|
1871
|
+
key: "addLocale",
|
|
1872
|
+
value: function addLocale(locale, data) {
|
|
1873
|
+
if (_typeof(data.contexts) !== 'object' || _typeof(data.contexts['']) !== 'object') {
|
|
1874
|
+
throw new TypeError("Locale '".concat(locale, "' invalid compact format"));
|
|
1875
|
+
}
|
|
1820
1876
|
|
|
1821
|
-
|
|
1822
|
-
* Register locale translations.
|
|
1823
|
-
* @param {string} locale Locale name (i.e.: `'he'`, `'fr'`)
|
|
1824
|
-
* @param {LocaleDate} data parsed data from a `.po` file.
|
|
1825
|
-
*/
|
|
1826
|
-
addLocale: function addLocale(locale, data) {
|
|
1827
|
-
if (_typeof(data.contexts) !== 'object' || _typeof(data.contexts['']) !== 'object') {
|
|
1828
|
-
throw new TypeError("Locale '".concat(locale, "' invalid compact format"));
|
|
1877
|
+
this.locales[locale.toLowerCase()] = data.contexts[''];
|
|
1829
1878
|
}
|
|
1879
|
+
/**
|
|
1880
|
+
* Activates a locale. Throws an error if the locale has not been previously added.
|
|
1881
|
+
* After setting the locale to be used, all strings marked for translations
|
|
1882
|
+
* will be represented by the corresponding translation in the specified locale.
|
|
1883
|
+
* @param {string} locale Locale name (i.e: `'he'`, `'fr'`)
|
|
1884
|
+
* @return {LocaleData}
|
|
1885
|
+
*/
|
|
1830
1886
|
|
|
1831
|
-
|
|
1832
|
-
|
|
1887
|
+
}, {
|
|
1888
|
+
key: "useLocale",
|
|
1889
|
+
value: function useLocale(locale) {
|
|
1890
|
+
var locale0 = locale.toLowerCase();
|
|
1891
|
+
var obj = this.locales[locale0];
|
|
1833
1892
|
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
* will be represented by the corresponding translation in the specified locale.
|
|
1838
|
-
* @param {string} locale Locale name (i.e: `'he'`, `'fr'`)
|
|
1839
|
-
* @return {LocaleData}
|
|
1840
|
-
*/
|
|
1841
|
-
useLocale: function useLocale(locale) {
|
|
1842
|
-
var locale0 = locale.toLowerCase();
|
|
1843
|
-
var obj = this.locales[locale0];
|
|
1893
|
+
if (!obj) {
|
|
1894
|
+
throw new RangeError("Locale '".concat(locale, "' not found"));
|
|
1895
|
+
}
|
|
1844
1896
|
|
|
1845
|
-
|
|
1846
|
-
|
|
1897
|
+
this.activeName = alias[locale0] || locale0;
|
|
1898
|
+
this.activeLocale = obj;
|
|
1899
|
+
return this.activeLocale;
|
|
1847
1900
|
}
|
|
1901
|
+
/**
|
|
1902
|
+
* Returns the name of the active locale (i.e. 'he', 'ashkenazi', 'fr')
|
|
1903
|
+
* @return {string}
|
|
1904
|
+
*/
|
|
1848
1905
|
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1906
|
+
}, {
|
|
1907
|
+
key: "getLocaleName",
|
|
1908
|
+
value: function getLocaleName() {
|
|
1909
|
+
return this.activeName;
|
|
1910
|
+
}
|
|
1911
|
+
/**
|
|
1912
|
+
* Returns the names of registered locales
|
|
1913
|
+
* @return {string[]}
|
|
1914
|
+
*/
|
|
1853
1915
|
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1916
|
+
}, {
|
|
1917
|
+
key: "getLocaleNames",
|
|
1918
|
+
value: function getLocaleNames() {
|
|
1919
|
+
return Object.keys(this.locales).sort();
|
|
1920
|
+
}
|
|
1921
|
+
/**
|
|
1922
|
+
* @param {number} n
|
|
1923
|
+
* @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
|
|
1924
|
+
* @return {string}
|
|
1925
|
+
*/
|
|
1861
1926
|
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
return Object.keys(this.locales).sort();
|
|
1868
|
-
},
|
|
1927
|
+
}, {
|
|
1928
|
+
key: "ordinal",
|
|
1929
|
+
value: function ordinal(n, locale) {
|
|
1930
|
+
var locale1 = locale && locale.toLowerCase();
|
|
1931
|
+
var locale0 = locale1 || this.activeName;
|
|
1869
1932
|
|
|
1870
|
-
|
|
1871
|
-
* @param {number} n
|
|
1872
|
-
* @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
|
|
1873
|
-
* @return {string}
|
|
1874
|
-
*/
|
|
1875
|
-
ordinal: function ordinal(n, locale) {
|
|
1876
|
-
var locale1 = locale && locale.toLowerCase();
|
|
1877
|
-
var locale0 = locale1 || this.activeName;
|
|
1878
|
-
|
|
1879
|
-
if (!locale0) {
|
|
1880
|
-
return this.getEnOrdinal(n);
|
|
1881
|
-
}
|
|
1882
|
-
|
|
1883
|
-
switch (locale0) {
|
|
1884
|
-
case 'en':
|
|
1885
|
-
case 's':
|
|
1886
|
-
case 'a':
|
|
1887
|
-
case 'ashkenazi':
|
|
1888
|
-
case 'ashkenazi_litvish':
|
|
1889
|
-
case 'ashkenazi_poylish':
|
|
1890
|
-
case 'ashkenazi_standard':
|
|
1933
|
+
if (!locale0) {
|
|
1891
1934
|
return this.getEnOrdinal(n);
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
switch (locale0) {
|
|
1938
|
+
case 'en':
|
|
1939
|
+
case 's':
|
|
1940
|
+
case 'a':
|
|
1941
|
+
case 'ashkenazi':
|
|
1942
|
+
case 'ashkenazi_litvish':
|
|
1943
|
+
case 'ashkenazi_poylish':
|
|
1944
|
+
case 'ashkenazi_standard':
|
|
1945
|
+
return this.getEnOrdinal(n);
|
|
1892
1946
|
|
|
1893
|
-
|
|
1894
|
-
|
|
1947
|
+
case 'es':
|
|
1948
|
+
return n + 'º';
|
|
1895
1949
|
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1950
|
+
case 'h':
|
|
1951
|
+
case 'he':
|
|
1952
|
+
case 'he-x-nonikud':
|
|
1953
|
+
return String(n);
|
|
1900
1954
|
|
|
1901
|
-
|
|
1902
|
-
|
|
1955
|
+
default:
|
|
1956
|
+
return n + '.';
|
|
1957
|
+
}
|
|
1903
1958
|
}
|
|
1904
|
-
|
|
1959
|
+
/**
|
|
1960
|
+
* @private
|
|
1961
|
+
* @param {number} n
|
|
1962
|
+
* @return {string}
|
|
1963
|
+
*/
|
|
1905
1964
|
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1965
|
+
}, {
|
|
1966
|
+
key: "getEnOrdinal",
|
|
1967
|
+
value: function getEnOrdinal(n) {
|
|
1968
|
+
var s = ['th', 'st', 'nd', 'rd'];
|
|
1969
|
+
var v = n % 100;
|
|
1970
|
+
return n + (s[(v - 20) % 10] || s[v] || s[0]);
|
|
1971
|
+
}
|
|
1972
|
+
/**
|
|
1973
|
+
* Removes nekudot from Hebrew string
|
|
1974
|
+
* @param {string} str
|
|
1975
|
+
* @return {string}
|
|
1976
|
+
*/
|
|
1977
|
+
|
|
1978
|
+
}, {
|
|
1979
|
+
key: "hebrewStripNikkud",
|
|
1980
|
+
value: function hebrewStripNikkud(str) {
|
|
1981
|
+
return str.replace(/[\u0590-\u05bd]/g, '').replace(/[\u05bf-\u05c7]/g, '');
|
|
1982
|
+
}
|
|
1983
|
+
}]);
|
|
1984
|
+
|
|
1985
|
+
return Locale;
|
|
1986
|
+
}();
|
|
1987
|
+
|
|
1988
|
+
_defineProperty(Locale, "locales", Object.create(null));
|
|
1989
|
+
|
|
1990
|
+
_defineProperty(Locale, "activeLocale", null);
|
|
1991
|
+
|
|
1992
|
+
_defineProperty(Locale, "activeName", null);
|
|
1916
1993
|
|
|
1917
|
-
/**
|
|
1918
|
-
* Removes nekudot from Hebrew string
|
|
1919
|
-
* @param {string} str
|
|
1920
|
-
* @return {string}
|
|
1921
|
-
*/
|
|
1922
|
-
hebrewStripNikkud: function hebrewStripNikkud(str) {
|
|
1923
|
-
return str.replace(/[\u0590-\u05bd]/g, '').replace(/[\u05bf-\u05c7]/g, '');
|
|
1924
|
-
}
|
|
1925
|
-
};
|
|
1926
1994
|
Locale.addLocale('en', noopLocale);
|
|
1927
1995
|
Locale.addLocale('s', noopLocale);
|
|
1928
1996
|
Locale.addLocale('', noopLocale);
|
|
@@ -4564,7 +4632,7 @@ var TZEIT_3MEDIUM_STARS = 7.083;
|
|
|
4564
4632
|
* @param {HDate} hd
|
|
4565
4633
|
* @param {number} dow
|
|
4566
4634
|
* @param {Location} location
|
|
4567
|
-
* @param {
|
|
4635
|
+
* @param {CalOptions} options
|
|
4568
4636
|
* @return {Event}
|
|
4569
4637
|
*/
|
|
4570
4638
|
|
|
@@ -6972,7 +7040,7 @@ function getBirthdayOrAnniversary_(hyear, gdate) {
|
|
|
6972
7040
|
return new HDate(day, month, hyear);
|
|
6973
7041
|
}
|
|
6974
7042
|
|
|
6975
|
-
var version="3.33.
|
|
7043
|
+
var version="3.33.5";
|
|
6976
7044
|
|
|
6977
7045
|
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};
|
|
6978
7046
|
|
|
@@ -7062,7 +7130,7 @@ var RECOGNIZED_OPTIONS = {
|
|
|
7062
7130
|
};
|
|
7063
7131
|
/**
|
|
7064
7132
|
* @private
|
|
7065
|
-
* @param {
|
|
7133
|
+
* @param {CalOptions} options
|
|
7066
7134
|
*/
|
|
7067
7135
|
|
|
7068
7136
|
function warnUnrecognizedOptions(options) {
|
|
@@ -7091,7 +7159,7 @@ function shallowCopy(target, source) {
|
|
|
7091
7159
|
/**
|
|
7092
7160
|
* Modifies options in-place
|
|
7093
7161
|
* @private
|
|
7094
|
-
* @param {
|
|
7162
|
+
* @param {CalOptions} options
|
|
7095
7163
|
*/
|
|
7096
7164
|
|
|
7097
7165
|
|
|
@@ -7126,7 +7194,7 @@ function checkCandleOptions(options) {
|
|
|
7126
7194
|
}
|
|
7127
7195
|
/**
|
|
7128
7196
|
* Options to configure which events are returned
|
|
7129
|
-
* @typedef {Object}
|
|
7197
|
+
* @typedef {Object} CalOptions
|
|
7130
7198
|
* @property {Location} location - latitude/longitude/tzid used for candle-lighting
|
|
7131
7199
|
* @property {number} year - Gregorian or Hebrew year
|
|
7132
7200
|
* @property {boolean} isHebrewYear - to interpret year as Hebrew year
|
|
@@ -7182,7 +7250,7 @@ function getAbs(d) {
|
|
|
7182
7250
|
/**
|
|
7183
7251
|
* Parse options object to determine start & end days
|
|
7184
7252
|
* @private
|
|
7185
|
-
* @param {
|
|
7253
|
+
* @param {CalOptions} options
|
|
7186
7254
|
* @return {number[]}
|
|
7187
7255
|
*/
|
|
7188
7256
|
|
|
@@ -7260,7 +7328,7 @@ function getStartAndEnd(options) {
|
|
|
7260
7328
|
/**
|
|
7261
7329
|
* Mask to filter Holiday array
|
|
7262
7330
|
* @private
|
|
7263
|
-
* @param {
|
|
7331
|
+
* @param {CalOptions} options
|
|
7264
7332
|
* @return {number}
|
|
7265
7333
|
*/
|
|
7266
7334
|
|
|
@@ -7391,7 +7459,7 @@ var HebrewCalendar = /*#__PURE__*/function () {
|
|
|
7391
7459
|
key: "calendar",
|
|
7392
7460
|
value:
|
|
7393
7461
|
/**
|
|
7394
|
-
* Calculates holidays and other Hebrew calendar events based on {@link
|
|
7462
|
+
* Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.
|
|
7395
7463
|
*
|
|
7396
7464
|
* Each holiday is represented by an {@link Event} object which includes a date,
|
|
7397
7465
|
* a description, flags and optional attributes.
|
|
@@ -7487,7 +7555,7 @@ var HebrewCalendar = /*#__PURE__*/function () {
|
|
|
7487
7555
|
* const date = hd.greg();
|
|
7488
7556
|
* console.log(date.toLocaleDateString(), ev.render(), hd.toString());
|
|
7489
7557
|
* }
|
|
7490
|
-
* @param {
|
|
7558
|
+
* @param {CalOptions} [options={}]
|
|
7491
7559
|
* @return {Event[]}
|
|
7492
7560
|
*/
|
|
7493
7561
|
function calendar() {
|
|
@@ -7762,11 +7830,11 @@ var HebrewCalendar = /*#__PURE__*/function () {
|
|
|
7762
7830
|
}
|
|
7763
7831
|
/**
|
|
7764
7832
|
* Helper function to format a 23-hour (00:00-23:59) time in US format ("8:13pm") or
|
|
7765
|
-
* keep as "20:13" for any other locale/country. Uses `
|
|
7833
|
+
* keep as "20:13" for any other locale/country. Uses `CalOptions` to determine
|
|
7766
7834
|
* locale.
|
|
7767
7835
|
* @param {string} timeStr - original time like "20:30"
|
|
7768
7836
|
* @param {string} suffix - "p" or "pm" or " P.M.". Add leading space if you want it
|
|
7769
|
-
* @param {
|
|
7837
|
+
* @param {CalOptions} options
|
|
7770
7838
|
* @return {string}
|
|
7771
7839
|
*/
|
|
7772
7840
|
|
|
@@ -7822,7 +7890,7 @@ var HebrewCalendar = /*#__PURE__*/function () {
|
|
|
7822
7890
|
* @private
|
|
7823
7891
|
* @param {Event[]} events
|
|
7824
7892
|
* @param {Event} ev
|
|
7825
|
-
* @param {
|
|
7893
|
+
* @param {CalOptions} options
|
|
7826
7894
|
* @param {Event} candlesEv
|
|
7827
7895
|
* @param {number} dow
|
|
7828
7896
|
* @return {Event}
|