@hebcal/core 3.33.4 → 3.33.7
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 +408 -303
- 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 +77 -62
- package/dist/hdate.mjs +77 -62
- package/dist/index.js +190 -118
- package/dist/index.mjs +174 -122
- package/hebcal.d.ts +116 -115
- package/package.json +3 -3
package/dist/hdate-bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v3.33.
|
|
1
|
+
/*! @hebcal/core v3.33.7 */
|
|
2
2
|
var hebcal = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -202,6 +202,21 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
202
202
|
return Constructor;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
function _defineProperty(obj, key, value) {
|
|
206
|
+
if (key in obj) {
|
|
207
|
+
Object.defineProperty(obj, key, {
|
|
208
|
+
value: value,
|
|
209
|
+
enumerable: true,
|
|
210
|
+
configurable: true,
|
|
211
|
+
writable: true
|
|
212
|
+
});
|
|
213
|
+
} else {
|
|
214
|
+
obj[key] = value;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return obj;
|
|
218
|
+
}
|
|
219
|
+
|
|
205
220
|
/*
|
|
206
221
|
Hebcal - A Jewish Calendar Generator
|
|
207
222
|
Copyright (c) 1994-2020 Danny Sadinoff
|
|
@@ -245,148 +260,172 @@ function quotient(x, y) {
|
|
|
245
260
|
}
|
|
246
261
|
/**
|
|
247
262
|
* Gregorian date helper functions.
|
|
248
|
-
* @namespace
|
|
249
263
|
*/
|
|
250
264
|
|
|
251
265
|
|
|
252
|
-
var greg = {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
* @type {string[]}
|
|
257
|
-
*/
|
|
258
|
-
monthNames: ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
|
266
|
+
var greg = /*#__PURE__*/function () {
|
|
267
|
+
function greg() {
|
|
268
|
+
_classCallCheck(this, greg);
|
|
269
|
+
}
|
|
259
270
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
271
|
+
_createClass(greg, null, [{
|
|
272
|
+
key: "isLeapYear",
|
|
273
|
+
value:
|
|
274
|
+
/**
|
|
275
|
+
* Long names of the Gregorian months (1='January', 12='December')
|
|
276
|
+
* @readonly
|
|
277
|
+
* @type {string[]}
|
|
278
|
+
*/
|
|
268
279
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
280
|
+
/**
|
|
281
|
+
* Returns true if the Gregorian year is a leap year
|
|
282
|
+
* @param {number} year Gregorian year
|
|
283
|
+
* @return {boolean}
|
|
284
|
+
*/
|
|
285
|
+
function isLeapYear(year) {
|
|
286
|
+
return !(year % 4) && (!!(year % 100) || !(year % 400));
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Number of days in the Gregorian month for given year
|
|
290
|
+
* @param {number} month Gregorian month (1=January, 12=December)
|
|
291
|
+
* @param {number} year Gregorian year
|
|
292
|
+
* @return {number}
|
|
293
|
+
*/
|
|
279
294
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
295
|
+
}, {
|
|
296
|
+
key: "daysInMonth",
|
|
297
|
+
value: function daysInMonth(month, year) {
|
|
298
|
+
// 1 based months
|
|
299
|
+
return monthLengths[+this.isLeapYear(year)][month];
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Returns true if the object is a Javascript Date
|
|
303
|
+
* @param {Object} obj
|
|
304
|
+
* @return {boolean}
|
|
305
|
+
*/
|
|
288
306
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
*/
|
|
294
|
-
dayOfYear: function dayOfYear(date) {
|
|
295
|
-
if (!this.isDate(date)) {
|
|
296
|
-
throw new TypeError('Argument to greg.dayOfYear not a Date');
|
|
307
|
+
}, {
|
|
308
|
+
key: "isDate",
|
|
309
|
+
value: function isDate(obj) {
|
|
310
|
+
return _typeof(obj) === 'object' && Date.prototype === obj.__proto__;
|
|
297
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Returns number of days since January 1 of that year
|
|
314
|
+
* @param {Date} date Gregorian date
|
|
315
|
+
* @return {number}
|
|
316
|
+
*/
|
|
298
317
|
|
|
299
|
-
|
|
318
|
+
}, {
|
|
319
|
+
key: "dayOfYear",
|
|
320
|
+
value: function dayOfYear(date) {
|
|
321
|
+
if (!this.isDate(date)) {
|
|
322
|
+
throw new TypeError('Argument to greg.dayOfYear not a Date');
|
|
323
|
+
}
|
|
300
324
|
|
|
301
|
-
|
|
302
|
-
// FEB
|
|
303
|
-
doy -= Math.floor((4 * (date.getMonth() + 1) + 23) / 10);
|
|
325
|
+
var doy = date.getDate() + 31 * date.getMonth();
|
|
304
326
|
|
|
305
|
-
if (
|
|
306
|
-
|
|
327
|
+
if (date.getMonth() > 1) {
|
|
328
|
+
// FEB
|
|
329
|
+
doy -= Math.floor((4 * (date.getMonth() + 1) + 23) / 10);
|
|
330
|
+
|
|
331
|
+
if (this.isLeapYear(date.getFullYear())) {
|
|
332
|
+
doy++;
|
|
333
|
+
}
|
|
307
334
|
}
|
|
335
|
+
|
|
336
|
+
return doy;
|
|
308
337
|
}
|
|
338
|
+
/**
|
|
339
|
+
* Converts Gregorian date to absolute R.D. (Rata Die) days
|
|
340
|
+
* @param {Date} date Gregorian date
|
|
341
|
+
* @return {number}
|
|
342
|
+
*/
|
|
309
343
|
|
|
310
|
-
|
|
311
|
-
|
|
344
|
+
}, {
|
|
345
|
+
key: "greg2abs",
|
|
346
|
+
value: function greg2abs(date) {
|
|
347
|
+
if (!this.isDate(date)) {
|
|
348
|
+
throw new TypeError('Argument to greg.greg2abs not a Date');
|
|
349
|
+
}
|
|
312
350
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if (!this.isDate(date)) {
|
|
320
|
-
throw new TypeError('Argument to greg.greg2abs not a Date');
|
|
351
|
+
var year = date.getFullYear() - 1;
|
|
352
|
+
return this.dayOfYear(date) + // days this year
|
|
353
|
+
365 * year + ( // + days in prior years
|
|
354
|
+
Math.floor(year / 4) - // + Julian Leap years
|
|
355
|
+
Math.floor(year / 100) + // - century years
|
|
356
|
+
Math.floor(year / 400)); // + Gregorian leap years
|
|
321
357
|
}
|
|
358
|
+
/**
|
|
359
|
+
* @private
|
|
360
|
+
* @param {number} theDate - R.D. number of days
|
|
361
|
+
* @return {number}
|
|
362
|
+
*/
|
|
322
363
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
364
|
+
}, {
|
|
365
|
+
key: "yearFromFixed",
|
|
366
|
+
value: function yearFromFixed(theDate) {
|
|
367
|
+
var l0 = theDate - 1;
|
|
368
|
+
var n400 = quotient(l0, 146097);
|
|
369
|
+
var d1 = mod(l0, 146097);
|
|
370
|
+
var n100 = quotient(d1, 36524);
|
|
371
|
+
var d2 = mod(d1, 36524);
|
|
372
|
+
var n4 = quotient(d2, 1461);
|
|
373
|
+
var d3 = mod(d2, 1461);
|
|
374
|
+
var n1 = quotient(d3, 365);
|
|
375
|
+
var year = 400 * n400 + 100 * n100 + 4 * n4 + n1;
|
|
376
|
+
return n100 != 4 && n1 != 4 ? year + 1 : year;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* @private
|
|
380
|
+
* @param {number} year
|
|
381
|
+
* @param {number} month
|
|
382
|
+
* @param {number} day
|
|
383
|
+
* @return {number}
|
|
384
|
+
*/
|
|
330
385
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
return n100 != 4 && n1 != 4 ? year + 1 : year;
|
|
347
|
-
},
|
|
386
|
+
}, {
|
|
387
|
+
key: "toFixed",
|
|
388
|
+
value: function toFixed(year, month, day) {
|
|
389
|
+
var py = year - 1;
|
|
390
|
+
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;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Converts from Rata Die (R.D. number) to Gregorian date.
|
|
394
|
+
* See the footnote on page 384 of ``Calendrical Calculations, Part II:
|
|
395
|
+
* Three Historical Calendars'' by E. M. Reingold, N. Dershowitz, and S. M.
|
|
396
|
+
* Clamen, Software--Practice and Experience, Volume 23, Number 4
|
|
397
|
+
* (April, 1993), pages 383-404 for an explanation.
|
|
398
|
+
* @param {number} theDate - R.D. number of days
|
|
399
|
+
* @return {Date}
|
|
400
|
+
*/
|
|
348
401
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
*/
|
|
356
|
-
toFixed: function toFixed(year, month, day) {
|
|
357
|
-
var py = year - 1;
|
|
358
|
-
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;
|
|
359
|
-
},
|
|
402
|
+
}, {
|
|
403
|
+
key: "abs2greg",
|
|
404
|
+
value: function abs2greg(theDate) {
|
|
405
|
+
if (typeof theDate !== 'number') {
|
|
406
|
+
throw new TypeError('Argument to greg.abs2greg not a Number');
|
|
407
|
+
}
|
|
360
408
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
* @return {Date}
|
|
369
|
-
*/
|
|
370
|
-
abs2greg: function abs2greg(theDate) {
|
|
371
|
-
if (typeof theDate !== 'number') {
|
|
372
|
-
throw new TypeError('Argument to greg.abs2greg not a Number');
|
|
373
|
-
}
|
|
409
|
+
theDate = Math.trunc(theDate);
|
|
410
|
+
var year = this.yearFromFixed(theDate);
|
|
411
|
+
var priorDays = theDate - this.toFixed(year, 1, 1);
|
|
412
|
+
var correction = theDate < this.toFixed(year, 3, 1) ? 0 : this.isLeapYear(year) ? 1 : 2;
|
|
413
|
+
var month = quotient(12 * (priorDays + correction) + 373, 367);
|
|
414
|
+
var day = theDate - this.toFixed(year, month, 1) + 1;
|
|
415
|
+
var dt = new Date(year, month - 1, day);
|
|
374
416
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
var correction = theDate < this.toFixed(year, 3, 1) ? 0 : this.isLeapYear(year) ? 1 : 2;
|
|
379
|
-
var month = quotient(12 * (priorDays + correction) + 373, 367);
|
|
380
|
-
var day = theDate - this.toFixed(year, month, 1) + 1;
|
|
381
|
-
var dt = new Date(year, month - 1, day);
|
|
417
|
+
if (year < 100 && year >= 0) {
|
|
418
|
+
dt.setFullYear(year);
|
|
419
|
+
}
|
|
382
420
|
|
|
383
|
-
|
|
384
|
-
dt.setFullYear(year);
|
|
421
|
+
return dt;
|
|
385
422
|
}
|
|
423
|
+
}]);
|
|
386
424
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
425
|
+
return greg;
|
|
426
|
+
}();
|
|
427
|
+
|
|
428
|
+
_defineProperty(greg, "monthNames", ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']);
|
|
390
429
|
|
|
391
430
|
var noopLocale = {
|
|
392
431
|
headers: {
|
|
@@ -409,159 +448,188 @@ var alias = {
|
|
|
409
448
|
* * `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
|
|
410
449
|
* * `he` - Hebrew (e.g. "שַׁבָּת")
|
|
411
450
|
* * `he-x-NoNikud` - Hebrew without nikud (e.g. "שבת")
|
|
412
|
-
* @namespace
|
|
413
451
|
*/
|
|
414
452
|
|
|
415
|
-
var Locale = {
|
|
416
|
-
|
|
417
|
-
|
|
453
|
+
var Locale = /*#__PURE__*/function () {
|
|
454
|
+
function Locale() {
|
|
455
|
+
_classCallCheck(this, Locale);
|
|
456
|
+
}
|
|
418
457
|
|
|
419
|
-
|
|
420
|
-
|
|
458
|
+
_createClass(Locale, null, [{
|
|
459
|
+
key: "lookupTranslation",
|
|
460
|
+
value:
|
|
461
|
+
/** @private */
|
|
421
462
|
|
|
422
|
-
|
|
423
|
-
activeName: null,
|
|
463
|
+
/** @private */
|
|
424
464
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
465
|
+
/** @private */
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Returns translation only if `locale` offers a non-empty translation for `id`.
|
|
469
|
+
* Otherwise, returns `undefined`.
|
|
470
|
+
* @param {string} id Message ID to translate
|
|
471
|
+
* @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
|
|
472
|
+
* @return {string}
|
|
473
|
+
*/
|
|
474
|
+
function lookupTranslation(id, locale) {
|
|
475
|
+
var locale0 = locale && locale.toLowerCase();
|
|
476
|
+
var loc = typeof locale == 'string' && this.locales[locale0] || this.activeLocale;
|
|
477
|
+
var array = loc[id];
|
|
478
|
+
|
|
479
|
+
if (array && array.length && array[0].length) {
|
|
480
|
+
return array[0];
|
|
481
|
+
}
|
|
436
482
|
|
|
437
|
-
|
|
438
|
-
return array[0];
|
|
483
|
+
return undefined;
|
|
439
484
|
}
|
|
485
|
+
/**
|
|
486
|
+
* By default, if no translation was found, returns `id`.
|
|
487
|
+
* @param {string} id Message ID to translate
|
|
488
|
+
* @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
|
|
489
|
+
* @return {string}
|
|
490
|
+
*/
|
|
440
491
|
|
|
441
|
-
|
|
442
|
-
|
|
492
|
+
}, {
|
|
493
|
+
key: "gettext",
|
|
494
|
+
value: function gettext(id, locale) {
|
|
495
|
+
var text = this.lookupTranslation(id, locale);
|
|
443
496
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
* @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
|
|
448
|
-
* @return {string}
|
|
449
|
-
*/
|
|
450
|
-
gettext: function gettext(id, locale) {
|
|
451
|
-
var text = this.lookupTranslation(id, locale);
|
|
497
|
+
if (typeof text == 'undefined') {
|
|
498
|
+
return id;
|
|
499
|
+
}
|
|
452
500
|
|
|
453
|
-
|
|
454
|
-
return id;
|
|
501
|
+
return text;
|
|
455
502
|
}
|
|
503
|
+
/**
|
|
504
|
+
* Register locale translations.
|
|
505
|
+
* @param {string} locale Locale name (i.e.: `'he'`, `'fr'`)
|
|
506
|
+
* @param {LocaleDate} data parsed data from a `.po` file.
|
|
507
|
+
*/
|
|
456
508
|
|
|
457
|
-
|
|
458
|
-
|
|
509
|
+
}, {
|
|
510
|
+
key: "addLocale",
|
|
511
|
+
value: function addLocale(locale, data) {
|
|
512
|
+
if (_typeof(data.contexts) !== 'object' || _typeof(data.contexts['']) !== 'object') {
|
|
513
|
+
throw new TypeError("Locale '".concat(locale, "' invalid compact format"));
|
|
514
|
+
}
|
|
459
515
|
|
|
460
|
-
|
|
461
|
-
* Register locale translations.
|
|
462
|
-
* @param {string} locale Locale name (i.e.: `'he'`, `'fr'`)
|
|
463
|
-
* @param {LocaleDate} data parsed data from a `.po` file.
|
|
464
|
-
*/
|
|
465
|
-
addLocale: function addLocale(locale, data) {
|
|
466
|
-
if (_typeof(data.contexts) !== 'object' || _typeof(data.contexts['']) !== 'object') {
|
|
467
|
-
throw new TypeError("Locale '".concat(locale, "' invalid compact format"));
|
|
516
|
+
this.locales[locale.toLowerCase()] = data.contexts[''];
|
|
468
517
|
}
|
|
518
|
+
/**
|
|
519
|
+
* Activates a locale. Throws an error if the locale has not been previously added.
|
|
520
|
+
* After setting the locale to be used, all strings marked for translations
|
|
521
|
+
* will be represented by the corresponding translation in the specified locale.
|
|
522
|
+
* @param {string} locale Locale name (i.e: `'he'`, `'fr'`)
|
|
523
|
+
* @return {LocaleData}
|
|
524
|
+
*/
|
|
469
525
|
|
|
470
|
-
|
|
471
|
-
|
|
526
|
+
}, {
|
|
527
|
+
key: "useLocale",
|
|
528
|
+
value: function useLocale(locale) {
|
|
529
|
+
var locale0 = locale.toLowerCase();
|
|
530
|
+
var obj = this.locales[locale0];
|
|
472
531
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
* will be represented by the corresponding translation in the specified locale.
|
|
477
|
-
* @param {string} locale Locale name (i.e: `'he'`, `'fr'`)
|
|
478
|
-
* @return {LocaleData}
|
|
479
|
-
*/
|
|
480
|
-
useLocale: function useLocale(locale) {
|
|
481
|
-
var locale0 = locale.toLowerCase();
|
|
482
|
-
var obj = this.locales[locale0];
|
|
532
|
+
if (!obj) {
|
|
533
|
+
throw new RangeError("Locale '".concat(locale, "' not found"));
|
|
534
|
+
}
|
|
483
535
|
|
|
484
|
-
|
|
485
|
-
|
|
536
|
+
this.activeName = alias[locale0] || locale0;
|
|
537
|
+
this.activeLocale = obj;
|
|
538
|
+
return this.activeLocale;
|
|
486
539
|
}
|
|
540
|
+
/**
|
|
541
|
+
* Returns the name of the active locale (i.e. 'he', 'ashkenazi', 'fr')
|
|
542
|
+
* @return {string}
|
|
543
|
+
*/
|
|
487
544
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
545
|
+
}, {
|
|
546
|
+
key: "getLocaleName",
|
|
547
|
+
value: function getLocaleName() {
|
|
548
|
+
return this.activeName;
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Returns the names of registered locales
|
|
552
|
+
* @return {string[]}
|
|
553
|
+
*/
|
|
492
554
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
555
|
+
}, {
|
|
556
|
+
key: "getLocaleNames",
|
|
557
|
+
value: function getLocaleNames() {
|
|
558
|
+
return Object.keys(this.locales).sort();
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* @param {number} n
|
|
562
|
+
* @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
|
|
563
|
+
* @return {string}
|
|
564
|
+
*/
|
|
500
565
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
return Object.keys(this.locales).sort();
|
|
507
|
-
},
|
|
566
|
+
}, {
|
|
567
|
+
key: "ordinal",
|
|
568
|
+
value: function ordinal(n, locale) {
|
|
569
|
+
var locale1 = locale && locale.toLowerCase();
|
|
570
|
+
var locale0 = locale1 || this.activeName;
|
|
508
571
|
|
|
509
|
-
|
|
510
|
-
* @param {number} n
|
|
511
|
-
* @param {string} [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to active locale.
|
|
512
|
-
* @return {string}
|
|
513
|
-
*/
|
|
514
|
-
ordinal: function ordinal(n, locale) {
|
|
515
|
-
var locale1 = locale && locale.toLowerCase();
|
|
516
|
-
var locale0 = locale1 || this.activeName;
|
|
517
|
-
|
|
518
|
-
if (!locale0) {
|
|
519
|
-
return this.getEnOrdinal(n);
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
switch (locale0) {
|
|
523
|
-
case 'en':
|
|
524
|
-
case 's':
|
|
525
|
-
case 'a':
|
|
526
|
-
case 'ashkenazi':
|
|
527
|
-
case 'ashkenazi_litvish':
|
|
528
|
-
case 'ashkenazi_poylish':
|
|
529
|
-
case 'ashkenazi_standard':
|
|
572
|
+
if (!locale0) {
|
|
530
573
|
return this.getEnOrdinal(n);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
switch (locale0) {
|
|
577
|
+
case 'en':
|
|
578
|
+
case 's':
|
|
579
|
+
case 'a':
|
|
580
|
+
case 'ashkenazi':
|
|
581
|
+
case 'ashkenazi_litvish':
|
|
582
|
+
case 'ashkenazi_poylish':
|
|
583
|
+
case 'ashkenazi_standard':
|
|
584
|
+
return this.getEnOrdinal(n);
|
|
531
585
|
|
|
532
|
-
|
|
533
|
-
|
|
586
|
+
case 'es':
|
|
587
|
+
return n + 'º';
|
|
534
588
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
589
|
+
case 'h':
|
|
590
|
+
case 'he':
|
|
591
|
+
case 'he-x-nonikud':
|
|
592
|
+
return String(n);
|
|
539
593
|
|
|
540
|
-
|
|
541
|
-
|
|
594
|
+
default:
|
|
595
|
+
return n + '.';
|
|
596
|
+
}
|
|
542
597
|
}
|
|
543
|
-
|
|
598
|
+
/**
|
|
599
|
+
* @private
|
|
600
|
+
* @param {number} n
|
|
601
|
+
* @return {string}
|
|
602
|
+
*/
|
|
544
603
|
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
604
|
+
}, {
|
|
605
|
+
key: "getEnOrdinal",
|
|
606
|
+
value: function getEnOrdinal(n) {
|
|
607
|
+
var s = ['th', 'st', 'nd', 'rd'];
|
|
608
|
+
var v = n % 100;
|
|
609
|
+
return n + (s[(v - 20) % 10] || s[v] || s[0]);
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* Removes nekudot from Hebrew string
|
|
613
|
+
* @param {string} str
|
|
614
|
+
* @return {string}
|
|
615
|
+
*/
|
|
616
|
+
|
|
617
|
+
}, {
|
|
618
|
+
key: "hebrewStripNikkud",
|
|
619
|
+
value: function hebrewStripNikkud(str) {
|
|
620
|
+
return str.replace(/[\u0590-\u05bd]/g, '').replace(/[\u05bf-\u05c7]/g, '');
|
|
621
|
+
}
|
|
622
|
+
}]);
|
|
623
|
+
|
|
624
|
+
return Locale;
|
|
625
|
+
}();
|
|
626
|
+
|
|
627
|
+
_defineProperty(Locale, "locales", Object.create(null));
|
|
628
|
+
|
|
629
|
+
_defineProperty(Locale, "activeLocale", null);
|
|
630
|
+
|
|
631
|
+
_defineProperty(Locale, "activeName", null);
|
|
555
632
|
|
|
556
|
-
/**
|
|
557
|
-
* Removes nekudot from Hebrew string
|
|
558
|
-
* @param {string} str
|
|
559
|
-
* @return {string}
|
|
560
|
-
*/
|
|
561
|
-
hebrewStripNikkud: function hebrewStripNikkud(str) {
|
|
562
|
-
return str.replace(/[\u0590-\u05bd]/g, '').replace(/[\u05bf-\u05c7]/g, '');
|
|
563
|
-
}
|
|
564
|
-
};
|
|
565
633
|
Locale.addLocale('en', noopLocale);
|
|
566
634
|
Locale.addLocale('s', noopLocale);
|
|
567
635
|
Locale.addLocale('', noopLocale);
|
|
@@ -1815,7 +1883,7 @@ function getBirthdayOrAnniversary_(hyear, gdate) {
|
|
|
1815
1883
|
return new HDate(day, month, hyear);
|
|
1816
1884
|
}
|
|
1817
1885
|
|
|
1818
|
-
var version="3.33.
|
|
1886
|
+
var version="3.33.7";
|
|
1819
1887
|
|
|
1820
1888
|
var headers={"plural-forms":"nplurals=2; plural=(n > 1);",language:"he"};var contexts={"":{Adar:["אַדָר"],"Adar I":["אַדָר א׳"],"Adar II":["אַדָר ב׳"],Av:["אָב"],Cheshvan:["חֶשְׁוָן"],Elul:["אֱלוּל"],Iyyar:["אִיָיר"],Kislev:["כִּסְלֵו"],Nisan:["נִיסָן"],"Sh'vat":["שְׁבָט"],Sivan:["סִיוָן"],Tamuz:["תַּמּוּז"],Tevet:["טֵבֵת"],Tishrei:["תִשְׁרֵי"]}};var poHeMin = {headers:headers,contexts:contexts};
|
|
1821
1889
|
|