@hebcal/rest-api 4.3.4 → 4.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/bundle.js +79 -192
- package/dist/bundle.min.js +2 -2
- package/dist/fullcalendar.js +13 -56
- package/dist/fullcalendar.min.js +2 -2
- package/dist/index.js +30 -143
- package/dist/index.mjs +30 -141
- package/package.json +15 -15
package/dist/bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/rest-api v4.3.
|
|
1
|
+
/*! @hebcal/rest-api v4.3.6 */
|
|
2
2
|
var hebcal__rest_api = (function (exports, core, leyning, triennial) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -85,37 +85,27 @@ var FunctionPrototype$1 = Function.prototype;
|
|
|
85
85
|
var call$b = FunctionPrototype$1.call;
|
|
86
86
|
var uncurryThisWithBind = NATIVE_BIND$1 && FunctionPrototype$1.bind.bind(call$b, call$b);
|
|
87
87
|
|
|
88
|
-
var
|
|
89
|
-
return
|
|
88
|
+
var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
|
|
89
|
+
return function () {
|
|
90
90
|
return call$b.apply(fn, arguments);
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
var
|
|
94
|
+
var uncurryThis$i = functionUncurryThis;
|
|
95
95
|
|
|
96
|
-
var toString$6 =
|
|
97
|
-
var stringSlice$5 =
|
|
96
|
+
var toString$6 = uncurryThis$i({}.toString);
|
|
97
|
+
var stringSlice$5 = uncurryThis$i(''.slice);
|
|
98
98
|
|
|
99
99
|
var classofRaw$2 = function (it) {
|
|
100
100
|
return stringSlice$5(toString$6(it), 8, -1);
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
var
|
|
104
|
-
var uncurryThisRaw = functionUncurryThisRaw;
|
|
105
|
-
|
|
106
|
-
var functionUncurryThis = function (fn) {
|
|
107
|
-
// Nashorn bug:
|
|
108
|
-
// https://github.com/zloirock/core-js/issues/1128
|
|
109
|
-
// https://github.com/zloirock/core-js/issues/1130
|
|
110
|
-
if (classofRaw$1(fn) === 'Function') return uncurryThisRaw(fn);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
var uncurryThis$g = functionUncurryThis;
|
|
103
|
+
var uncurryThis$h = functionUncurryThis;
|
|
114
104
|
var fails$e = fails$h;
|
|
115
105
|
var classof$6 = classofRaw$2;
|
|
116
106
|
|
|
117
107
|
var $Object$4 = Object;
|
|
118
|
-
var split$3 = uncurryThis$
|
|
108
|
+
var split$3 = uncurryThis$h(''.split);
|
|
119
109
|
|
|
120
110
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
121
111
|
var indexedObject = fails$e(function () {
|
|
@@ -195,9 +185,9 @@ var getBuiltIn$5 = function (namespace, method) {
|
|
|
195
185
|
return arguments.length < 2 ? aFunction(global$f[namespace]) : global$f[namespace] && global$f[namespace][method];
|
|
196
186
|
};
|
|
197
187
|
|
|
198
|
-
var uncurryThis$
|
|
188
|
+
var uncurryThis$g = functionUncurryThis;
|
|
199
189
|
|
|
200
|
-
var objectIsPrototypeOf = uncurryThis$
|
|
190
|
+
var objectIsPrototypeOf = uncurryThis$g({}.isPrototypeOf);
|
|
201
191
|
|
|
202
192
|
var getBuiltIn$4 = getBuiltIn$5;
|
|
203
193
|
|
|
@@ -345,10 +335,10 @@ var store$2 = sharedStore;
|
|
|
345
335
|
(shared$4.exports = function (key, value) {
|
|
346
336
|
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
|
347
337
|
})('versions', []).push({
|
|
348
|
-
version: '3.
|
|
338
|
+
version: '3.26.1',
|
|
349
339
|
mode: 'global',
|
|
350
340
|
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
|
|
351
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
341
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE',
|
|
352
342
|
source: 'https://github.com/zloirock/core-js'
|
|
353
343
|
});
|
|
354
344
|
|
|
@@ -362,10 +352,10 @@ var toObject$4 = function (argument) {
|
|
|
362
352
|
return $Object$2(requireObjectCoercible$2(argument));
|
|
363
353
|
};
|
|
364
354
|
|
|
365
|
-
var uncurryThis$
|
|
355
|
+
var uncurryThis$f = functionUncurryThis;
|
|
366
356
|
var toObject$3 = toObject$4;
|
|
367
357
|
|
|
368
|
-
var hasOwnProperty = uncurryThis$
|
|
358
|
+
var hasOwnProperty = uncurryThis$f({}.hasOwnProperty);
|
|
369
359
|
|
|
370
360
|
// `HasOwnProperty` abstract operation
|
|
371
361
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
@@ -374,11 +364,11 @@ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
|
374
364
|
return hasOwnProperty(toObject$3(it), key);
|
|
375
365
|
};
|
|
376
366
|
|
|
377
|
-
var uncurryThis$
|
|
367
|
+
var uncurryThis$e = functionUncurryThis;
|
|
378
368
|
|
|
379
369
|
var id = 0;
|
|
380
370
|
var postfix = Math.random();
|
|
381
|
-
var toString$5 = uncurryThis$
|
|
371
|
+
var toString$5 = uncurryThis$e(1.0.toString);
|
|
382
372
|
|
|
383
373
|
var uid$2 = function (key) {
|
|
384
374
|
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$5(++id + postfix, 36);
|
|
@@ -592,11 +582,11 @@ var functionName = {
|
|
|
592
582
|
CONFIGURABLE: CONFIGURABLE
|
|
593
583
|
};
|
|
594
584
|
|
|
595
|
-
var uncurryThis$
|
|
585
|
+
var uncurryThis$d = functionUncurryThis;
|
|
596
586
|
var isCallable$b = isCallable$h;
|
|
597
587
|
var store$1 = sharedStore;
|
|
598
588
|
|
|
599
|
-
var functionToString = uncurryThis$
|
|
589
|
+
var functionToString = uncurryThis$d(Function.toString);
|
|
600
590
|
|
|
601
591
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
602
592
|
if (!isCallable$b(store$1.inspectSource)) {
|
|
@@ -861,13 +851,13 @@ var arrayIncludes = {
|
|
|
861
851
|
indexOf: createMethod$1(false)
|
|
862
852
|
};
|
|
863
853
|
|
|
864
|
-
var uncurryThis$
|
|
854
|
+
var uncurryThis$c = functionUncurryThis;
|
|
865
855
|
var hasOwn$6 = hasOwnProperty_1;
|
|
866
856
|
var toIndexedObject$2 = toIndexedObject$5;
|
|
867
857
|
var indexOf$1 = arrayIncludes.indexOf;
|
|
868
858
|
var hiddenKeys$2 = hiddenKeys$4;
|
|
869
859
|
|
|
870
|
-
var push$3 = uncurryThis$
|
|
860
|
+
var push$3 = uncurryThis$c([].push);
|
|
871
861
|
|
|
872
862
|
var objectKeysInternal = function (object, names) {
|
|
873
863
|
var O = toIndexedObject$2(object);
|
|
@@ -911,12 +901,12 @@ var objectGetOwnPropertySymbols = {};
|
|
|
911
901
|
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
912
902
|
|
|
913
903
|
var getBuiltIn$2 = getBuiltIn$5;
|
|
914
|
-
var uncurryThis$
|
|
904
|
+
var uncurryThis$b = functionUncurryThis;
|
|
915
905
|
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
916
906
|
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
917
907
|
var anObject$9 = anObject$b;
|
|
918
908
|
|
|
919
|
-
var concat$1 = uncurryThis$
|
|
909
|
+
var concat$1 = uncurryThis$b([].concat);
|
|
920
910
|
|
|
921
911
|
// all object keys, includes non-enumerable and symbols
|
|
922
912
|
var ownKeys$1 = getBuiltIn$2('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
@@ -1031,14 +1021,14 @@ var toStringTagSupport = String(test) === '[object z]';
|
|
|
1031
1021
|
|
|
1032
1022
|
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
|
1033
1023
|
var isCallable$6 = isCallable$h;
|
|
1034
|
-
var classofRaw = classofRaw$2;
|
|
1024
|
+
var classofRaw$1 = classofRaw$2;
|
|
1035
1025
|
var wellKnownSymbol$b = wellKnownSymbol$e;
|
|
1036
1026
|
|
|
1037
1027
|
var TO_STRING_TAG$2 = wellKnownSymbol$b('toStringTag');
|
|
1038
1028
|
var $Object$1 = Object;
|
|
1039
1029
|
|
|
1040
1030
|
// ES3 wrong here
|
|
1041
|
-
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
1031
|
+
var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) == 'Arguments';
|
|
1042
1032
|
|
|
1043
1033
|
// fallback for IE11 Script Access Denied error
|
|
1044
1034
|
var tryGet = function (it, key) {
|
|
@@ -1048,15 +1038,15 @@ var tryGet = function (it, key) {
|
|
|
1048
1038
|
};
|
|
1049
1039
|
|
|
1050
1040
|
// getting tag from ES6+ `Object.prototype.toString`
|
|
1051
|
-
var classof$5 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
|
1041
|
+
var classof$5 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
|
|
1052
1042
|
var O, tag, result;
|
|
1053
1043
|
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
1054
1044
|
// @@toStringTag case
|
|
1055
1045
|
: typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$2)) == 'string' ? tag
|
|
1056
1046
|
// builtinTag case
|
|
1057
|
-
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
1047
|
+
: CORRECT_ARGUMENTS ? classofRaw$1(O)
|
|
1058
1048
|
// ES3 arguments fallback
|
|
1059
|
-
: (result = classofRaw(O)) == 'Object' && isCallable$6(O.callee) ? 'Arguments' : result;
|
|
1049
|
+
: (result = classofRaw$1(O)) == 'Object' && isCallable$6(O.callee) ? 'Arguments' : result;
|
|
1060
1050
|
};
|
|
1061
1051
|
|
|
1062
1052
|
var classof$4 = classof$5;
|
|
@@ -1265,7 +1255,7 @@ var regexpUnsupportedNcg = fails$6(function () {
|
|
|
1265
1255
|
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
1266
1256
|
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
1267
1257
|
var call$7 = functionCall;
|
|
1268
|
-
var uncurryThis$
|
|
1258
|
+
var uncurryThis$a = functionUncurryThis;
|
|
1269
1259
|
var toString$3 = toString$4;
|
|
1270
1260
|
var regexpFlags = regexpFlags$1;
|
|
1271
1261
|
var stickyHelpers = regexpStickyHelpers;
|
|
@@ -1278,10 +1268,10 @@ var UNSUPPORTED_NCG = regexpUnsupportedNcg;
|
|
|
1278
1268
|
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
1279
1269
|
var nativeExec = RegExp.prototype.exec;
|
|
1280
1270
|
var patchedExec = nativeExec;
|
|
1281
|
-
var charAt$4 = uncurryThis$
|
|
1282
|
-
var indexOf = uncurryThis$
|
|
1283
|
-
var replace$3 = uncurryThis$
|
|
1284
|
-
var stringSlice$4 = uncurryThis$
|
|
1271
|
+
var charAt$4 = uncurryThis$a(''.charAt);
|
|
1272
|
+
var indexOf = uncurryThis$a(''.indexOf);
|
|
1273
|
+
var replace$3 = uncurryThis$a(''.replace);
|
|
1274
|
+
var stringSlice$4 = uncurryThis$a(''.slice);
|
|
1285
1275
|
|
|
1286
1276
|
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
1287
1277
|
var re1 = /a/;
|
|
@@ -1573,7 +1563,7 @@ var aPossiblePrototype$1 = function (argument) {
|
|
|
1573
1563
|
|
|
1574
1564
|
/* eslint-disable no-proto -- safe */
|
|
1575
1565
|
|
|
1576
|
-
var uncurryThis$
|
|
1566
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
1577
1567
|
var anObject$5 = anObject$b;
|
|
1578
1568
|
var aPossiblePrototype = aPossiblePrototype$1;
|
|
1579
1569
|
|
|
@@ -1587,7 +1577,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
|
|
|
1587
1577
|
var setter;
|
|
1588
1578
|
try {
|
|
1589
1579
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1590
|
-
setter = uncurryThis$
|
|
1580
|
+
setter = uncurryThis$9(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
1591
1581
|
setter(test, []);
|
|
1592
1582
|
CORRECT_SETTER = test instanceof Array;
|
|
1593
1583
|
} catch (error) { /* empty */ }
|
|
@@ -1803,14 +1793,14 @@ for (var COLLECTION_NAME in DOMIterables) {
|
|
|
1803
1793
|
|
|
1804
1794
|
handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
1805
1795
|
|
|
1806
|
-
var uncurryThis$
|
|
1796
|
+
var uncurryThis$8 = functionUncurryThis;
|
|
1807
1797
|
var toIntegerOrInfinity = toIntegerOrInfinity$3;
|
|
1808
1798
|
var toString$2 = toString$4;
|
|
1809
1799
|
var requireObjectCoercible$1 = requireObjectCoercible$4;
|
|
1810
1800
|
|
|
1811
|
-
var charAt$3 = uncurryThis$
|
|
1812
|
-
var charCodeAt$1 = uncurryThis$
|
|
1813
|
-
var stringSlice$3 = uncurryThis$
|
|
1801
|
+
var charAt$3 = uncurryThis$8(''.charAt);
|
|
1802
|
+
var charCodeAt$1 = uncurryThis$8(''.charCodeAt);
|
|
1803
|
+
var stringSlice$3 = uncurryThis$8(''.slice);
|
|
1814
1804
|
|
|
1815
1805
|
var createMethod = function (CONVERT_TO_STRING) {
|
|
1816
1806
|
return function ($this, pos) {
|
|
@@ -1906,7 +1896,17 @@ var urlConstructorDetection = !fails$3(function () {
|
|
|
1906
1896
|
|| new URL('http://x', undefined).host !== 'x';
|
|
1907
1897
|
});
|
|
1908
1898
|
|
|
1909
|
-
var
|
|
1899
|
+
var classofRaw = classofRaw$2;
|
|
1900
|
+
var uncurryThis$7 = functionUncurryThis;
|
|
1901
|
+
|
|
1902
|
+
var functionUncurryThisClause = function (fn) {
|
|
1903
|
+
// Nashorn bug:
|
|
1904
|
+
// https://github.com/zloirock/core-js/issues/1128
|
|
1905
|
+
// https://github.com/zloirock/core-js/issues/1130
|
|
1906
|
+
if (classofRaw(fn) === 'Function') return uncurryThis$7(fn);
|
|
1907
|
+
};
|
|
1908
|
+
|
|
1909
|
+
var uncurryThis$6 = functionUncurryThisClause;
|
|
1910
1910
|
var aCallable$1 = aCallable$3;
|
|
1911
1911
|
var NATIVE_BIND = functionBindNative;
|
|
1912
1912
|
|
|
@@ -3910,7 +3910,7 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
|
|
|
3910
3910
|
};
|
|
3911
3911
|
|
|
3912
3912
|
var $ = _export;
|
|
3913
|
-
var uncurryThis =
|
|
3913
|
+
var uncurryThis = functionUncurryThisClause;
|
|
3914
3914
|
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
3915
3915
|
var toLength = toLength$2;
|
|
3916
3916
|
var toString = toString$4;
|
|
@@ -3991,7 +3991,6 @@ var AD="Andorra";var AE="United Arab Emirates";var AF="Afghanistan";var AI="Angu
|
|
|
3991
3991
|
* @param {Location} location
|
|
3992
3992
|
* @return {string}
|
|
3993
3993
|
*/
|
|
3994
|
-
|
|
3995
3994
|
function locationToPlainObj(location) {
|
|
3996
3995
|
if (typeof location === 'object' && location !== null && typeof location.name === 'string') {
|
|
3997
3996
|
const o = {
|
|
@@ -4015,6 +4014,7 @@ function locationToPlainObj(location) {
|
|
|
4015
4014
|
};
|
|
4016
4015
|
}
|
|
4017
4016
|
}
|
|
4017
|
+
|
|
4018
4018
|
/**
|
|
4019
4019
|
* Helper function to transform a string to make it more usable in a URL or filename.
|
|
4020
4020
|
* Converts to lowercase and replaces non-word characters with hyphen ('-').
|
|
@@ -4023,25 +4023,21 @@ function locationToPlainObj(location) {
|
|
|
4023
4023
|
* @param {string} s
|
|
4024
4024
|
* @return {string}
|
|
4025
4025
|
*/
|
|
4026
|
-
|
|
4027
4026
|
function makeAnchor(s) {
|
|
4028
4027
|
return s.toLowerCase().replace(/'/g, '').replace(/[^\w]/g, '-').replace(/-+/g, '-').replace(/^-/g, '').replace(/-$/g, '');
|
|
4029
4028
|
}
|
|
4029
|
+
|
|
4030
4030
|
/**
|
|
4031
4031
|
* @param {CalOptions} options
|
|
4032
4032
|
* @return {string}
|
|
4033
4033
|
*/
|
|
4034
|
-
|
|
4035
4034
|
function getDownloadFilename(options) {
|
|
4036
4035
|
let fileName = 'hebcal';
|
|
4037
|
-
|
|
4038
4036
|
if (options.year) {
|
|
4039
4037
|
fileName += '_' + options.year;
|
|
4040
|
-
|
|
4041
4038
|
if (options.isHebrewYear) {
|
|
4042
4039
|
fileName += 'h';
|
|
4043
4040
|
}
|
|
4044
|
-
|
|
4045
4041
|
if (options.month) {
|
|
4046
4042
|
fileName += '_' + options.month;
|
|
4047
4043
|
}
|
|
@@ -4050,42 +4046,37 @@ function getDownloadFilename(options) {
|
|
|
4050
4046
|
const end = new core.HDate(options.end);
|
|
4051
4047
|
const y1 = start.greg().getFullYear();
|
|
4052
4048
|
const y2 = end.greg().getFullYear();
|
|
4053
|
-
|
|
4054
4049
|
if (y1 === y2) {
|
|
4055
4050
|
fileName += '_' + y1;
|
|
4056
4051
|
} else {
|
|
4057
4052
|
fileName += '_' + y1 + '_' + y2;
|
|
4058
4053
|
}
|
|
4059
4054
|
}
|
|
4060
|
-
|
|
4061
4055
|
if (typeof options.location === 'object') {
|
|
4062
4056
|
const loc = options.location;
|
|
4063
4057
|
const name = loc.zip || loc.asciiname || loc.getShortName();
|
|
4064
|
-
|
|
4065
4058
|
if (name) {
|
|
4066
4059
|
fileName += '_' + makeAnchor(name).replace(/[-]/g, '_');
|
|
4067
4060
|
}
|
|
4068
4061
|
}
|
|
4069
|
-
|
|
4070
4062
|
return fileName;
|
|
4071
4063
|
}
|
|
4064
|
+
|
|
4072
4065
|
/**
|
|
4073
4066
|
* @param {number} number
|
|
4074
4067
|
* @return {string}
|
|
4075
4068
|
*/
|
|
4076
|
-
|
|
4077
4069
|
function pad2(number) {
|
|
4078
4070
|
if (number < 10) {
|
|
4079
4071
|
return '0' + number;
|
|
4080
4072
|
}
|
|
4081
|
-
|
|
4082
4073
|
return '' + number;
|
|
4083
4074
|
}
|
|
4075
|
+
|
|
4084
4076
|
/**
|
|
4085
4077
|
* @param {number} number
|
|
4086
4078
|
* @return {string}
|
|
4087
4079
|
*/
|
|
4088
|
-
|
|
4089
4080
|
function pad4(number) {
|
|
4090
4081
|
if (number < 0) {
|
|
4091
4082
|
return '-00' + pad4(-number);
|
|
@@ -4096,59 +4087,51 @@ function pad4(number) {
|
|
|
4096
4087
|
} else if (number < 1000) {
|
|
4097
4088
|
return '0' + number;
|
|
4098
4089
|
}
|
|
4099
|
-
|
|
4100
4090
|
return '' + number;
|
|
4101
4091
|
}
|
|
4092
|
+
|
|
4102
4093
|
/**
|
|
4103
4094
|
* Returns just the date portion as YYYY-MM-DD
|
|
4104
4095
|
* @param {Date} d
|
|
4105
4096
|
* @return {string}
|
|
4106
4097
|
*/
|
|
4107
|
-
|
|
4108
4098
|
function toISOString(d) {
|
|
4109
4099
|
return pad4(d.getFullYear()) + '-' + pad2(d.getMonth() + 1) + '-' + pad2(d.getDate());
|
|
4110
4100
|
}
|
|
4111
|
-
const flagToCategory = [[core.flags.MAJOR_FAST, 'holiday', 'major', 'fast'], [core.flags.CHANUKAH_CANDLES, 'holiday', 'major'], [core.flags.DAF_YOMI, 'dafyomi'], [core.flags.HEBREW_DATE, 'hebdate'], [core.flags.MINOR_FAST, 'holiday', 'fast'], [core.flags.MINOR_HOLIDAY, 'holiday', 'minor'], [core.flags.MISHNA_YOMI, 'mishnayomi'], [core.flags.MODERN_HOLIDAY, 'holiday', 'modern'], [core.flags.MOLAD, 'molad'], [core.flags.OMER_COUNT, 'omer'], [core.flags.PARSHA_HASHAVUA, 'parashat'],
|
|
4101
|
+
const flagToCategory = [[core.flags.MAJOR_FAST, 'holiday', 'major', 'fast'], [core.flags.CHANUKAH_CANDLES, 'holiday', 'major'], [core.flags.DAF_YOMI, 'dafyomi'], [core.flags.HEBREW_DATE, 'hebdate'], [core.flags.MINOR_FAST, 'holiday', 'fast'], [core.flags.MINOR_HOLIDAY, 'holiday', 'minor'], [core.flags.MISHNA_YOMI, 'mishnayomi'], [core.flags.MODERN_HOLIDAY, 'holiday', 'modern'], [core.flags.MOLAD, 'molad'], [core.flags.OMER_COUNT, 'omer'], [core.flags.PARSHA_HASHAVUA, 'parashat'],
|
|
4102
|
+
// backwards-compat
|
|
4112
4103
|
[core.flags.ROSH_CHODESH, 'roshchodesh'], [core.flags.SHABBAT_MEVARCHIM, 'mevarchim'], [core.flags.SPECIAL_SHABBAT, 'holiday', 'shabbat'], [core.flags.USER_EVENT, 'user']];
|
|
4104
|
+
|
|
4113
4105
|
/**
|
|
4114
4106
|
* Returns a category and subcategory name
|
|
4115
4107
|
* @param {Event} ev
|
|
4116
4108
|
* @return {string[]}
|
|
4117
4109
|
*/
|
|
4118
|
-
|
|
4119
4110
|
function getEventCategories(ev) {
|
|
4120
4111
|
const desc = ev.getDesc();
|
|
4121
|
-
|
|
4122
4112
|
switch (desc) {
|
|
4123
4113
|
// LIGHT_CANDLES or LIGHT_CANDLES_TZEIS
|
|
4124
4114
|
case 'Candle lighting':
|
|
4125
4115
|
return ['candles'];
|
|
4126
4116
|
// YOM_TOV_ENDS
|
|
4127
|
-
|
|
4128
4117
|
case 'Havdalah':
|
|
4129
4118
|
return ['havdalah'];
|
|
4130
4119
|
// flags.MINOR_FAST or flags.MAJOR_FAST
|
|
4131
|
-
|
|
4132
4120
|
case 'Fast begins':
|
|
4133
4121
|
case 'Fast ends':
|
|
4134
4122
|
return ['zmanim', 'fast'];
|
|
4135
4123
|
}
|
|
4136
|
-
|
|
4137
4124
|
if (ev.cholHaMoedDay) {
|
|
4138
4125
|
return ['holiday', 'major', 'cholhamoed'];
|
|
4139
4126
|
}
|
|
4140
|
-
|
|
4141
4127
|
const mask = ev.getFlags();
|
|
4142
|
-
|
|
4143
4128
|
for (let i = 0; i < flagToCategory.length; i++) {
|
|
4144
4129
|
const attrs = flagToCategory[i];
|
|
4145
|
-
|
|
4146
4130
|
if (mask & attrs[0]) {
|
|
4147
4131
|
return attrs.slice(1);
|
|
4148
4132
|
}
|
|
4149
|
-
}
|
|
4150
|
-
|
|
4151
|
-
|
|
4133
|
+
}
|
|
4134
|
+
// Don't depend on flags.MINOR_HOLIDAY always being set
|
|
4152
4135
|
switch (desc) {
|
|
4153
4136
|
case 'Lag BaOmer':
|
|
4154
4137
|
case 'Leil Selichot':
|
|
@@ -4160,31 +4143,29 @@ function getEventCategories(ev) {
|
|
|
4160
4143
|
case 'Tu BiShvat':
|
|
4161
4144
|
case 'Rosh Hashana LaBehemot':
|
|
4162
4145
|
return ['holiday', 'minor'];
|
|
4163
|
-
|
|
4164
4146
|
default:
|
|
4165
4147
|
return ['holiday', 'major'];
|
|
4166
4148
|
}
|
|
4167
4149
|
}
|
|
4150
|
+
|
|
4168
4151
|
/**
|
|
4169
4152
|
* Renders the event title in default locale, but strips off time
|
|
4170
4153
|
* @param {Event} ev
|
|
4171
4154
|
* @return {string}
|
|
4172
4155
|
*/
|
|
4173
|
-
|
|
4174
4156
|
function renderTitleWithoutTime(ev) {
|
|
4175
4157
|
return typeof ev.eventTime === 'undefined' ? ev.render() : ev.renderBrief();
|
|
4176
4158
|
}
|
|
4159
|
+
|
|
4177
4160
|
/**
|
|
4178
4161
|
* Generates a title like "Hebcal 2020 Israel" or "Hebcal May 1993 Providence"
|
|
4179
4162
|
* @param {Event[]} events
|
|
4180
4163
|
* @param {CalOptions} options
|
|
4181
4164
|
* @return {string}
|
|
4182
4165
|
*/
|
|
4183
|
-
|
|
4184
4166
|
function getCalendarTitle(events, options) {
|
|
4185
4167
|
let title = 'Hebcal';
|
|
4186
4168
|
const location = options.location;
|
|
4187
|
-
|
|
4188
4169
|
if (options.yahrzeit) {
|
|
4189
4170
|
title += ' Yahrzeits and Anniversaries';
|
|
4190
4171
|
} else if (location && location.name) {
|
|
@@ -4196,17 +4177,14 @@ function getCalendarTitle(events, options) {
|
|
|
4196
4177
|
} else {
|
|
4197
4178
|
title += ' Diaspora';
|
|
4198
4179
|
}
|
|
4199
|
-
|
|
4200
4180
|
if (options.subscribe == '1') {
|
|
4201
4181
|
return title;
|
|
4202
4182
|
}
|
|
4203
|
-
|
|
4204
4183
|
if (options.year && (options.isHebrewYear || events.length == 0)) {
|
|
4205
4184
|
title += ' ' + options.year;
|
|
4206
4185
|
} else if (events.length) {
|
|
4207
4186
|
const start = events[0].getDate().greg();
|
|
4208
4187
|
const end = events[events.length - 1].getDate().greg();
|
|
4209
|
-
|
|
4210
4188
|
if (start.getFullYear() != end.getFullYear()) {
|
|
4211
4189
|
title += ' ' + start.getFullYear() + '-' + end.getFullYear();
|
|
4212
4190
|
} else if (start.getMonth() == end.getMonth()) {
|
|
@@ -4219,72 +4197,63 @@ function getCalendarTitle(events, options) {
|
|
|
4219
4197
|
title += ' ' + start.getFullYear();
|
|
4220
4198
|
}
|
|
4221
4199
|
}
|
|
4222
|
-
|
|
4223
4200
|
return title;
|
|
4224
4201
|
}
|
|
4202
|
+
|
|
4225
4203
|
/**
|
|
4226
4204
|
* Returns an English language description of the holiday
|
|
4227
4205
|
* @param {Event} ev
|
|
4228
4206
|
* @param {boolean} [firstSentence=false]
|
|
4229
4207
|
* @return {string}
|
|
4230
4208
|
*/
|
|
4231
|
-
|
|
4232
4209
|
function getHolidayDescription(ev) {
|
|
4233
4210
|
let firstSentence = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
4234
4211
|
const str = holidayDescription[ev.getDesc()] || holidayDescription[ev.basename()] || '';
|
|
4235
|
-
|
|
4236
4212
|
if (firstSentence && str) {
|
|
4237
4213
|
const dot = str.indexOf('.');
|
|
4238
|
-
|
|
4239
4214
|
if (dot != -1) {
|
|
4240
4215
|
return str.substring(0, dot);
|
|
4241
4216
|
}
|
|
4242
4217
|
}
|
|
4243
|
-
|
|
4244
4218
|
return str;
|
|
4245
4219
|
}
|
|
4246
4220
|
const HOLIDAY_IGNORE_MASK = core.flags.DAF_YOMI | core.flags.OMER_COUNT | core.flags.SHABBAT_MEVARCHIM | core.flags.MOLAD | core.flags.USER_EVENT | core.flags.HEBREW_DATE;
|
|
4221
|
+
|
|
4247
4222
|
/**
|
|
4248
4223
|
* Makes mulit-line text that summarizes Torah & Haftarah
|
|
4249
4224
|
* @param {Event} ev
|
|
4250
4225
|
* @param {boolean} il
|
|
4251
4226
|
* @return {string}
|
|
4252
4227
|
*/
|
|
4253
|
-
|
|
4254
4228
|
function makeTorahMemoText(ev, il) {
|
|
4255
4229
|
const mask = ev.getFlags();
|
|
4256
|
-
|
|
4257
4230
|
if (mask & HOLIDAY_IGNORE_MASK) {
|
|
4258
4231
|
return '';
|
|
4232
|
+
} else if (typeof ev.eventTime !== 'undefined') {
|
|
4233
|
+
return '';
|
|
4259
4234
|
}
|
|
4260
|
-
|
|
4261
4235
|
const reading = mask & core.flags.PARSHA_HASHAVUA ? leyning.getLeyningForParshaHaShavua(ev, il) : leyning.getLeyningForHoliday(ev, il);
|
|
4262
4236
|
let memo = '';
|
|
4263
|
-
|
|
4264
4237
|
if (reading && (reading.summary || reading.haftara)) {
|
|
4265
4238
|
if (reading.summary) {
|
|
4266
4239
|
memo += "Torah: ".concat(reading.summary);
|
|
4267
4240
|
}
|
|
4268
|
-
|
|
4269
4241
|
if (reading.summary && reading.haftara) {
|
|
4270
4242
|
memo += '\n';
|
|
4271
4243
|
}
|
|
4272
|
-
|
|
4273
4244
|
if (reading.haftara) {
|
|
4274
4245
|
memo += 'Haftarah: ' + reading.haftara;
|
|
4275
|
-
|
|
4276
4246
|
if (reading.reason && reading.reason.haftara) {
|
|
4277
4247
|
memo += ' | ' + reading.reason.haftara;
|
|
4278
4248
|
}
|
|
4279
4249
|
}
|
|
4280
4250
|
}
|
|
4281
|
-
|
|
4282
4251
|
if (reading && reading.sephardic) {
|
|
4283
4252
|
memo += '\nHaftarah for Sephardim: ' + reading.sephardic;
|
|
4284
4253
|
}
|
|
4285
|
-
|
|
4286
4254
|
return memo;
|
|
4287
4255
|
}
|
|
4256
|
+
|
|
4288
4257
|
/**
|
|
4289
4258
|
* Appends utm_source and utm_medium parameters to a URL
|
|
4290
4259
|
* @param {string} url
|
|
@@ -4294,24 +4263,19 @@ function makeTorahMemoText(ev, il) {
|
|
|
4294
4263
|
* @param {string} utmCampaign
|
|
4295
4264
|
* @return {string}
|
|
4296
4265
|
*/
|
|
4297
|
-
|
|
4298
4266
|
function appendIsraelAndTracking(url, il, utmSource, utmMedium, utmCampaign) {
|
|
4299
4267
|
const u = new URL(url);
|
|
4300
4268
|
const isHebcal = u.host === 'www.hebcal.com';
|
|
4301
|
-
|
|
4302
4269
|
if (isHebcal) {
|
|
4303
4270
|
if (il) {
|
|
4304
4271
|
u.searchParams.set('i', 'on');
|
|
4305
4272
|
}
|
|
4306
|
-
|
|
4307
4273
|
const path = u.pathname;
|
|
4308
4274
|
const isHolidays = path.startsWith('/holidays/');
|
|
4309
4275
|
const isSedrot = path.startsWith('/sedrot/');
|
|
4310
4276
|
const isOmer = path.startsWith('/omer/');
|
|
4311
|
-
|
|
4312
4277
|
if (isHolidays || isSedrot || isOmer) {
|
|
4313
4278
|
u.host = 'hebcal.com';
|
|
4314
|
-
|
|
4315
4279
|
if (isHolidays) {
|
|
4316
4280
|
u.pathname = '/h/' + path.substring(10);
|
|
4317
4281
|
} else if (isSedrot) {
|
|
@@ -4320,51 +4284,41 @@ function appendIsraelAndTracking(url, il, utmSource, utmMedium, utmCampaign) {
|
|
|
4320
4284
|
// isOmer
|
|
4321
4285
|
u.pathname = '/o/' + path.substring(6);
|
|
4322
4286
|
}
|
|
4323
|
-
|
|
4324
4287
|
if (!utmCampaign || !(utmCampaign.startsWith('ical-') || utmCampaign.startsWith('pdf-'))) {
|
|
4325
4288
|
if (utmSource) {
|
|
4326
4289
|
u.searchParams.set('us', utmSource);
|
|
4327
4290
|
}
|
|
4328
|
-
|
|
4329
4291
|
if (utmMedium) {
|
|
4330
4292
|
u.searchParams.set('um', utmMedium);
|
|
4331
4293
|
}
|
|
4332
4294
|
}
|
|
4333
|
-
|
|
4334
4295
|
if (utmCampaign) {
|
|
4335
4296
|
u.searchParams.set('uc', utmCampaign);
|
|
4336
4297
|
}
|
|
4337
|
-
|
|
4338
4298
|
return u.toString();
|
|
4339
4299
|
}
|
|
4340
4300
|
}
|
|
4341
|
-
|
|
4342
4301
|
utmSource = isHebcal ? utmSource : 'hebcal.com';
|
|
4343
|
-
|
|
4344
4302
|
if (utmSource) {
|
|
4345
4303
|
u.searchParams.set('utm_source', utmSource);
|
|
4346
4304
|
}
|
|
4347
|
-
|
|
4348
4305
|
if (utmMedium) {
|
|
4349
4306
|
u.searchParams.set('utm_medium', utmMedium);
|
|
4350
4307
|
}
|
|
4351
|
-
|
|
4352
4308
|
if (utmCampaign) {
|
|
4353
4309
|
u.searchParams.set('utm_campaign', utmCampaign);
|
|
4354
4310
|
}
|
|
4355
|
-
|
|
4356
4311
|
return u.toString();
|
|
4357
4312
|
}
|
|
4313
|
+
|
|
4358
4314
|
/**
|
|
4359
4315
|
* @private
|
|
4360
4316
|
* @param {Event} ev
|
|
4361
4317
|
* @return {boolean}
|
|
4362
4318
|
*/
|
|
4363
|
-
|
|
4364
4319
|
function shouldRenderBrief(ev) {
|
|
4365
4320
|
if (typeof ev.eventTime !== 'undefined') return true;
|
|
4366
4321
|
const mask = ev.getFlags();
|
|
4367
|
-
|
|
4368
4322
|
if (mask & core.flags.HEBREW_DATE) {
|
|
4369
4323
|
const hd = ev.getDate();
|
|
4370
4324
|
return hd.getDate() === 1 ? false : true;
|
|
@@ -4379,6 +4333,7 @@ function shouldRenderBrief(ev) {
|
|
|
4379
4333
|
}
|
|
4380
4334
|
}
|
|
4381
4335
|
|
|
4336
|
+
// eslint-disable-next-line max-len
|
|
4382
4337
|
const csvHeader = '"Subject","Start Date","Start Time","End Date","End Time","All day event","Description","Show time as","Location"';
|
|
4383
4338
|
const CATEGORY = {
|
|
4384
4339
|
dafyomi: 'Daf Yomi',
|
|
@@ -4391,13 +4346,13 @@ const CATEGORY = {
|
|
|
4391
4346
|
roshchodesh: 'Jewish Holidays',
|
|
4392
4347
|
user: 'Personal'
|
|
4393
4348
|
};
|
|
4349
|
+
|
|
4394
4350
|
/**
|
|
4395
4351
|
* Renders an Event as a string
|
|
4396
4352
|
* @param {Event} e
|
|
4397
4353
|
* @param {CalOptions} options
|
|
4398
4354
|
* @return {string}
|
|
4399
4355
|
*/
|
|
4400
|
-
|
|
4401
4356
|
function eventToCsv(e, options) {
|
|
4402
4357
|
const d = e.getDate().greg();
|
|
4403
4358
|
const mday = d.getDate();
|
|
@@ -4410,62 +4365,51 @@ function eventToCsv(e, options) {
|
|
|
4410
4365
|
let allDay = '"true"';
|
|
4411
4366
|
const timed = Boolean(e.eventTime);
|
|
4412
4367
|
let subj = shouldRenderBrief(e) ? e.renderBrief(options.locale) : e.render(options.locale);
|
|
4413
|
-
|
|
4414
4368
|
if (e.eventTime) {
|
|
4415
4369
|
const timeStr = core.HebrewCalendar.reformatTimeStr(e.eventTimeStr, ' PM', options);
|
|
4416
4370
|
endTime = startTime = "\"".concat(timeStr, "\"");
|
|
4417
4371
|
endDate = date;
|
|
4418
4372
|
allDay = '"false"';
|
|
4419
4373
|
}
|
|
4420
|
-
|
|
4421
4374
|
let loc = 'Jewish Holidays';
|
|
4422
4375
|
const mask = e.getFlags();
|
|
4423
|
-
|
|
4424
4376
|
if (timed && options.location && options.location.name) {
|
|
4425
4377
|
const locationName = options.location.name;
|
|
4426
4378
|
const comma = locationName.indexOf(',');
|
|
4427
4379
|
loc = comma === -1 ? locationName : locationName.substring(0, comma);
|
|
4428
4380
|
} else if (mask & core.flags.DAF_YOMI) {
|
|
4429
4381
|
const colon = subj.indexOf(': ');
|
|
4430
|
-
|
|
4431
4382
|
if (colon != -1) {
|
|
4432
4383
|
loc = subj.substring(0, colon);
|
|
4433
4384
|
subj = subj.substring(colon + 2);
|
|
4434
4385
|
}
|
|
4435
4386
|
} else {
|
|
4436
4387
|
const category = CATEGORY[getEventCategories(e)[0]];
|
|
4437
|
-
|
|
4438
4388
|
if (category) {
|
|
4439
4389
|
loc = category;
|
|
4440
4390
|
}
|
|
4441
4391
|
}
|
|
4442
|
-
|
|
4443
4392
|
subj = subj.replace(/,/g, '').replace(/"/g, '\'\'');
|
|
4444
|
-
|
|
4445
4393
|
if (options.appendHebrewToSubject) {
|
|
4446
4394
|
const hebrew = e.renderBrief('he');
|
|
4447
|
-
|
|
4448
4395
|
if (hebrew) {
|
|
4449
4396
|
subj += " / ".concat(hebrew);
|
|
4450
4397
|
}
|
|
4451
4398
|
}
|
|
4452
|
-
|
|
4453
4399
|
let memo0 = e.memo || getHolidayDescription(e, true);
|
|
4454
|
-
|
|
4455
4400
|
if (!memo0 && typeof e.linkedEvent !== 'undefined') {
|
|
4456
4401
|
memo0 = e.linkedEvent.render(options.locale);
|
|
4457
4402
|
}
|
|
4458
|
-
|
|
4459
4403
|
const memo = memo0.replace(/,/g, ';').replace(/"/g, '\'\'').replace(/\n/g, ' / ');
|
|
4460
4404
|
const showTimeAs = timed || mask & core.flags.CHAG ? 4 : 3;
|
|
4461
4405
|
return "\"".concat(subj, "\",").concat(date, ",").concat(startTime, ",").concat(endDate, ",").concat(endTime, ",").concat(allDay, ",\"").concat(memo, "\",\"").concat(showTimeAs, "\",\"").concat(loc, "\"");
|
|
4462
4406
|
}
|
|
4407
|
+
|
|
4463
4408
|
/**
|
|
4464
4409
|
* @param {Event[]} events
|
|
4465
4410
|
* @param {HebcalOptions} options
|
|
4466
4411
|
* @return {string}
|
|
4467
4412
|
*/
|
|
4468
|
-
|
|
4469
4413
|
function eventsToCsv(events, options) {
|
|
4470
4414
|
return [csvHeader].concat(events.map(e => eventToCsv(e, options))).join('\r\n') + '\r\n';
|
|
4471
4415
|
}
|
|
@@ -4475,10 +4419,10 @@ function eventsToCsv(events, options) {
|
|
|
4475
4419
|
* @param {Event} ev
|
|
4476
4420
|
* @return {string}
|
|
4477
4421
|
*/
|
|
4478
|
-
|
|
4479
4422
|
function eventIsoDate(ev) {
|
|
4480
4423
|
return toISOString(ev.getDate().greg());
|
|
4481
4424
|
}
|
|
4425
|
+
|
|
4482
4426
|
/**
|
|
4483
4427
|
* Formats a list events for the classic Hebcal.com JSON API response
|
|
4484
4428
|
* @param {Event[]} events
|
|
@@ -4486,8 +4430,6 @@ function eventIsoDate(ev) {
|
|
|
4486
4430
|
* @param {boolean} [leyning=true]
|
|
4487
4431
|
* @return {Object}
|
|
4488
4432
|
*/
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
4433
|
function eventsToClassicApi(events, options) {
|
|
4492
4434
|
let leyning = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
4493
4435
|
const result = {
|
|
@@ -4495,17 +4437,16 @@ function eventsToClassicApi(events, options) {
|
|
|
4495
4437
|
date: new Date().toISOString()
|
|
4496
4438
|
};
|
|
4497
4439
|
result.location = locationToPlainObj(options.location);
|
|
4498
|
-
|
|
4499
4440
|
if (events.length) {
|
|
4500
4441
|
result.range = {
|
|
4501
4442
|
start: eventIsoDate(events[0]),
|
|
4502
4443
|
end: eventIsoDate(events[events.length - 1])
|
|
4503
4444
|
};
|
|
4504
4445
|
}
|
|
4505
|
-
|
|
4506
4446
|
result.items = events.map(ev => eventToClassicApiObject(ev, options, leyning));
|
|
4507
4447
|
return result;
|
|
4508
4448
|
}
|
|
4449
|
+
|
|
4509
4450
|
/**
|
|
4510
4451
|
* Converts a Hebcal event to a classic Hebcal.com JSON API object
|
|
4511
4452
|
* @param {Event} ev
|
|
@@ -4513,7 +4454,6 @@ function eventsToClassicApi(events, options) {
|
|
|
4513
4454
|
* @param {boolean} [leyning=true]
|
|
4514
4455
|
* @return {Object}
|
|
4515
4456
|
*/
|
|
4516
|
-
|
|
4517
4457
|
function eventToClassicApiObject(ev, options) {
|
|
4518
4458
|
let leyning$1 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
4519
4459
|
const timed = Boolean(ev.eventTime);
|
|
@@ -4526,63 +4466,48 @@ function eventToClassicApiObject(ev, options) {
|
|
|
4526
4466
|
let title = shouldRenderBrief(ev) ? ev.renderBrief(options.locale) : ev.render(options.locale);
|
|
4527
4467
|
const desc = ev.getDesc();
|
|
4528
4468
|
const candles = desc === 'Havdalah' || desc === 'Candle lighting';
|
|
4529
|
-
|
|
4530
4469
|
if (candles) {
|
|
4531
4470
|
const time = core.HebrewCalendar.reformatTimeStr(ev.eventTimeStr, 'pm', options);
|
|
4532
4471
|
title += ': ' + time;
|
|
4533
4472
|
}
|
|
4534
|
-
|
|
4535
4473
|
const result = {
|
|
4536
4474
|
title: title,
|
|
4537
4475
|
date: date
|
|
4538
4476
|
};
|
|
4539
|
-
|
|
4540
4477
|
if (!timed) {
|
|
4541
4478
|
result.hdate = hd.toString();
|
|
4542
4479
|
}
|
|
4543
|
-
|
|
4544
4480
|
result.category = categories[0];
|
|
4545
|
-
|
|
4546
4481
|
if (categories.length > 1) {
|
|
4547
4482
|
result.subcat = categories[1];
|
|
4548
4483
|
}
|
|
4549
|
-
|
|
4550
4484
|
if (categories[0] === 'holiday' && mask & core.flags.CHAG) {
|
|
4551
4485
|
result.yomtov = true;
|
|
4552
4486
|
}
|
|
4553
|
-
|
|
4554
4487
|
if (title != desc) {
|
|
4555
4488
|
result.title_orig = desc;
|
|
4556
4489
|
}
|
|
4557
|
-
|
|
4558
4490
|
const hebrew = ev.renderBrief('he');
|
|
4559
|
-
|
|
4560
4491
|
if (hebrew) {
|
|
4561
4492
|
result.hebrew = core.Locale.hebrewStripNikkud(hebrew);
|
|
4562
4493
|
}
|
|
4563
|
-
|
|
4564
4494
|
if (!candles) {
|
|
4565
4495
|
if (leyning$1) {
|
|
4566
4496
|
const il = options.il;
|
|
4567
4497
|
const isParsha = mask === core.flags.PARSHA_HASHAVUA;
|
|
4568
4498
|
const reading = isParsha ? leyning.getLeyningForParshaHaShavua(ev, il) : leyning.getLeyningForHoliday(ev, il);
|
|
4569
|
-
|
|
4570
4499
|
if (reading) {
|
|
4571
4500
|
result.leyning = formatLeyningResult(reading);
|
|
4572
4501
|
const hyear = hd.getFullYear();
|
|
4573
|
-
|
|
4574
4502
|
if (isParsha && !il && hyear >= 5745) {
|
|
4575
4503
|
const triReading = triennial.getTriennialForParshaHaShavua(ev);
|
|
4576
|
-
|
|
4577
4504
|
if (triReading) {
|
|
4578
4505
|
result.leyning.triennial = formatAliyot({}, triReading.aliyot);
|
|
4579
4506
|
}
|
|
4580
4507
|
}
|
|
4581
4508
|
}
|
|
4582
4509
|
}
|
|
4583
|
-
|
|
4584
4510
|
const url = ev.url();
|
|
4585
|
-
|
|
4586
4511
|
if (url) {
|
|
4587
4512
|
const utmSource = options.utmSource || 'js';
|
|
4588
4513
|
const utmMedium = options.utmMedium || 'api';
|
|
@@ -4590,7 +4515,6 @@ function eventToClassicApiObject(ev, options) {
|
|
|
4590
4515
|
result.link = appendIsraelAndTracking(url, options.il, utmSource, utmMedium, utmCampaign);
|
|
4591
4516
|
}
|
|
4592
4517
|
}
|
|
4593
|
-
|
|
4594
4518
|
if (mask & core.flags.OMER_COUNT) {
|
|
4595
4519
|
result.omer = {
|
|
4596
4520
|
count: {
|
|
@@ -4604,8 +4528,7 @@ function eventToClassicApiObject(ev, options) {
|
|
|
4604
4528
|
}
|
|
4605
4529
|
};
|
|
4606
4530
|
}
|
|
4607
|
-
|
|
4608
|
-
if (mask & core.flags.HEBREW_DATE) {
|
|
4531
|
+
if (options.heDateParts && !timed || mask & core.flags.HEBREW_DATE) {
|
|
4609
4532
|
const yy = hd.getFullYear();
|
|
4610
4533
|
const mm = hd.getMonthName();
|
|
4611
4534
|
const dd = hd.getDate();
|
|
@@ -4615,31 +4538,26 @@ function eventToClassicApiObject(ev, options) {
|
|
|
4615
4538
|
d: core.gematriya(dd)
|
|
4616
4539
|
};
|
|
4617
4540
|
}
|
|
4618
|
-
|
|
4619
4541
|
const memo = ev.memo || holidayDescription[ev.basename()];
|
|
4620
|
-
|
|
4621
4542
|
if (memo) {
|
|
4622
4543
|
result.memo = memo;
|
|
4623
4544
|
} else if (typeof ev.linkedEvent !== 'undefined') {
|
|
4624
4545
|
result.memo = ev.linkedEvent.render(options.locale);
|
|
4625
4546
|
}
|
|
4626
|
-
|
|
4627
4547
|
if (options.includeEvent) {
|
|
4628
4548
|
result.ev = ev;
|
|
4629
4549
|
}
|
|
4630
|
-
|
|
4631
4550
|
return result;
|
|
4632
4551
|
}
|
|
4552
|
+
|
|
4633
4553
|
/**
|
|
4634
4554
|
* @param {Object} result
|
|
4635
4555
|
* @param {Object} aliyot
|
|
4636
4556
|
* @return {Object}
|
|
4637
4557
|
*/
|
|
4638
|
-
|
|
4639
4558
|
function formatAliyot(result, aliyot) {
|
|
4640
4559
|
Object.keys(aliyot).forEach(num => {
|
|
4641
4560
|
const aliyah = aliyot[num];
|
|
4642
|
-
|
|
4643
4561
|
if (typeof aliyah !== 'undefined') {
|
|
4644
4562
|
const k = num == 'M' ? 'maftir' : num;
|
|
4645
4563
|
result[k] = leyning.formatAliyahWithBook(aliyah);
|
|
@@ -4647,31 +4565,25 @@ function formatAliyot(result, aliyot) {
|
|
|
4647
4565
|
});
|
|
4648
4566
|
return result;
|
|
4649
4567
|
}
|
|
4568
|
+
|
|
4650
4569
|
/**
|
|
4651
4570
|
* @param {Leyning} reading
|
|
4652
4571
|
* @return {Object}
|
|
4653
4572
|
*/
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
4573
|
function formatLeyningResult(reading) {
|
|
4657
4574
|
const result = {};
|
|
4658
|
-
|
|
4659
4575
|
if (reading.summary) {
|
|
4660
4576
|
result.torah = reading.summary;
|
|
4661
4577
|
}
|
|
4662
|
-
|
|
4663
4578
|
if (reading.haftara) {
|
|
4664
4579
|
result.haftarah = reading.haftara;
|
|
4665
4580
|
}
|
|
4666
|
-
|
|
4667
4581
|
if (reading.sephardic) {
|
|
4668
4582
|
result.haftarah_sephardic = reading.sephardic;
|
|
4669
4583
|
}
|
|
4670
|
-
|
|
4671
4584
|
if (reading.fullkriyah) {
|
|
4672
4585
|
formatAliyot(result, reading.fullkriyah);
|
|
4673
4586
|
}
|
|
4674
|
-
|
|
4675
4587
|
if (reading.reason) {
|
|
4676
4588
|
['7', '8', 'M'].forEach(num => {
|
|
4677
4589
|
if (reading.reason[num]) {
|
|
@@ -4679,12 +4591,10 @@ function formatLeyningResult(reading) {
|
|
|
4679
4591
|
result[k] += ' | ' + reading.reason[num];
|
|
4680
4592
|
}
|
|
4681
4593
|
});
|
|
4682
|
-
|
|
4683
4594
|
if (reading.reason.haftara) {
|
|
4684
4595
|
result.haftarah += ' | ' + reading.reason.haftara;
|
|
4685
4596
|
}
|
|
4686
4597
|
}
|
|
4687
|
-
|
|
4688
4598
|
return result;
|
|
4689
4599
|
}
|
|
4690
4600
|
|
|
@@ -4698,7 +4608,6 @@ function formatLeyningResult(reading) {
|
|
|
4698
4608
|
* @param {string} utmMedium
|
|
4699
4609
|
* @return {string[]}
|
|
4700
4610
|
*/
|
|
4701
|
-
|
|
4702
4611
|
function getLinkAndGuid(ev, il, tzid, mainUrl, utmSource, utmMedium) {
|
|
4703
4612
|
let link;
|
|
4704
4613
|
let guid;
|
|
@@ -4709,7 +4618,6 @@ function getLinkAndGuid(ev, il, tzid, mainUrl, utmSource, utmMedium) {
|
|
|
4709
4618
|
const descAnchor = makeAnchor(ev.getDesc());
|
|
4710
4619
|
const anchor = "".concat(dtAnchor, "-").concat(descAnchor);
|
|
4711
4620
|
const url0 = ev.url();
|
|
4712
|
-
|
|
4713
4621
|
if (url0) {
|
|
4714
4622
|
link = appendIsraelAndTracking(url0, il, utmSource, utmMedium).replace(/&/g, '&');
|
|
4715
4623
|
guid = "".concat(url0, "#").concat(anchor);
|
|
@@ -4719,10 +4627,8 @@ function getLinkAndGuid(ev, il, tzid, mainUrl, utmSource, utmMedium) {
|
|
|
4719
4627
|
guid = url1.replace(/&/g, '&') + "#".concat(anchor);
|
|
4720
4628
|
link = "".concat(url, "#").concat(anchor);
|
|
4721
4629
|
}
|
|
4722
|
-
|
|
4723
4630
|
return [link, guid];
|
|
4724
4631
|
}
|
|
4725
|
-
|
|
4726
4632
|
const localeToLg = {
|
|
4727
4633
|
's': 'en',
|
|
4728
4634
|
'a': 'en',
|
|
@@ -4731,12 +4637,12 @@ const localeToLg = {
|
|
|
4731
4637
|
'ah': 'en',
|
|
4732
4638
|
'sh': 'en'
|
|
4733
4639
|
};
|
|
4640
|
+
|
|
4734
4641
|
/**
|
|
4735
4642
|
* @param {Event[]} events
|
|
4736
4643
|
* @param {CalOptions} options
|
|
4737
4644
|
* @return {string}
|
|
4738
4645
|
*/
|
|
4739
|
-
|
|
4740
4646
|
function eventsToRss2(events, options) {
|
|
4741
4647
|
options.dayFormat = new Intl.DateTimeFormat('en-US', {
|
|
4742
4648
|
weekday: 'long',
|
|
@@ -4763,6 +4669,7 @@ function eventsToRss2(events, options) {
|
|
|
4763
4669
|
str += '</channel>\n</rss>\n';
|
|
4764
4670
|
return str;
|
|
4765
4671
|
}
|
|
4672
|
+
|
|
4766
4673
|
/**
|
|
4767
4674
|
* @private
|
|
4768
4675
|
* @param {Event} ev
|
|
@@ -4771,27 +4678,22 @@ function eventsToRss2(events, options) {
|
|
|
4771
4678
|
* @param {string} lastBuildDate
|
|
4772
4679
|
* @return {string}
|
|
4773
4680
|
*/
|
|
4774
|
-
|
|
4775
4681
|
function getPubDate(ev, evPubDate, evDate, lastBuildDate) {
|
|
4776
4682
|
if (evPubDate) {
|
|
4777
4683
|
const dt = ev.eventTime;
|
|
4778
|
-
|
|
4779
4684
|
if (dt) {
|
|
4780
4685
|
return dt.toUTCString();
|
|
4781
4686
|
}
|
|
4782
|
-
|
|
4783
4687
|
return evDate.toUTCString().replace(/ \S+ GMT$/, ' 00:00:00 GMT');
|
|
4784
4688
|
}
|
|
4785
|
-
|
|
4786
4689
|
return lastBuildDate;
|
|
4787
4690
|
}
|
|
4691
|
+
|
|
4788
4692
|
/**
|
|
4789
4693
|
* @param {Event} ev
|
|
4790
4694
|
* @param {CalOptions} options
|
|
4791
4695
|
* @return {string}
|
|
4792
4696
|
*/
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
4697
|
function eventToRssItem2(ev, options) {
|
|
4796
4698
|
let subj = ev.render();
|
|
4797
4699
|
const evDate = ev.getDate().greg();
|
|
@@ -4809,10 +4711,8 @@ function eventToRssItem2(ev, options) {
|
|
|
4809
4711
|
const desc = ev.getDesc();
|
|
4810
4712
|
const candles = desc === 'Havdalah' || desc === 'Candle lighting';
|
|
4811
4713
|
let memo;
|
|
4812
|
-
|
|
4813
4714
|
if (candles) {
|
|
4814
4715
|
const colon = subj.indexOf(': ');
|
|
4815
|
-
|
|
4816
4716
|
if (colon != -1) {
|
|
4817
4717
|
const options = {
|
|
4818
4718
|
location,
|
|
@@ -4825,7 +4725,6 @@ function eventToRssItem2(ev, options) {
|
|
|
4825
4725
|
} else {
|
|
4826
4726
|
memo = ev.getFlags() & core.flags.PARSHA_HASHAVUA ? makeTorahMemoText(ev, il) : ev.memo || holidayDescription[ev.basename()];
|
|
4827
4727
|
}
|
|
4828
|
-
|
|
4829
4728
|
const dayFormat = options.dayFormat;
|
|
4830
4729
|
const description = memo || dayFormat.format(evDate);
|
|
4831
4730
|
const geoTags = cat0 == 'candles' ? "<geo:lat>".concat(location.getLatitude(), "</geo:lat>\n<geo:long>").concat(location.getLongitude(), "</geo:long>\n") : '';
|
|
@@ -4839,15 +4738,12 @@ function eventToRssItem2(ev, options) {
|
|
|
4839
4738
|
* @param {boolean} il true if Israel
|
|
4840
4739
|
* @return {Object}
|
|
4841
4740
|
*/
|
|
4842
|
-
|
|
4843
4741
|
function eventToFullCalendar(ev, tzid, il) {
|
|
4844
4742
|
const classes = getEventCategories(ev);
|
|
4845
4743
|
const mask = ev.getFlags();
|
|
4846
|
-
|
|
4847
4744
|
if (classes[0] == 'holiday' && mask & core.flags.CHAG) {
|
|
4848
4745
|
classes.push('yomtov');
|
|
4849
4746
|
}
|
|
4850
|
-
|
|
4851
4747
|
const timed = Boolean(ev.eventTime);
|
|
4852
4748
|
const title = shouldRenderBrief(ev) ? ev.renderBrief() : ev.render();
|
|
4853
4749
|
const start = timed ? core.Zmanim.formatISOWithTimeZone(tzid, ev.eventTime) : toISOString(ev.getDate().greg());
|
|
@@ -4858,30 +4754,23 @@ function eventToFullCalendar(ev, tzid, il) {
|
|
|
4858
4754
|
className: classes.join(' ')
|
|
4859
4755
|
};
|
|
4860
4756
|
const hebrew = ev.renderBrief('he');
|
|
4861
|
-
|
|
4862
4757
|
if (hebrew) {
|
|
4863
4758
|
result.hebrew = core.Locale.hebrewStripNikkud(hebrew);
|
|
4864
4759
|
}
|
|
4865
|
-
|
|
4866
4760
|
const url = ev.url();
|
|
4867
|
-
|
|
4868
4761
|
if (url) {
|
|
4869
4762
|
result.url = appendIsraelAndTracking(url, il, 'js', 'fc');
|
|
4870
4763
|
}
|
|
4871
|
-
|
|
4872
4764
|
const desc = ev.getDesc();
|
|
4873
4765
|
const candles = desc === 'Havdalah' || desc === 'Candle lighting';
|
|
4874
|
-
|
|
4875
4766
|
if (!candles) {
|
|
4876
4767
|
const memo = mask & core.flags.PARSHA_HASHAVUA ? makeTorahMemoText(ev, il) : ev.memo || holidayDescription[ev.basename()];
|
|
4877
|
-
|
|
4878
4768
|
if (memo) {
|
|
4879
4769
|
result.description = memo;
|
|
4880
4770
|
} else if (typeof ev.linkedEvent !== 'undefined') {
|
|
4881
4771
|
result.description = ev.linkedEvent.render();
|
|
4882
4772
|
}
|
|
4883
4773
|
}
|
|
4884
|
-
|
|
4885
4774
|
return result;
|
|
4886
4775
|
}
|
|
4887
4776
|
|
|
@@ -4908,8 +4797,6 @@ exports.renderTitleWithoutTime = renderTitleWithoutTime;
|
|
|
4908
4797
|
exports.shouldRenderBrief = shouldRenderBrief;
|
|
4909
4798
|
exports.toISOString = toISOString;
|
|
4910
4799
|
|
|
4911
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4912
|
-
|
|
4913
4800
|
return exports;
|
|
4914
4801
|
|
|
4915
4802
|
})({}, hebcal, hebcal__leyning, hebcal__triennial);
|