@hebcal/icalendar 5.0.5 → 5.0.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/dist/index.cjs +18 -22
- package/dist/index.mjs +18 -22
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/icalendar v5.0.
|
|
1
|
+
/*! @hebcal/icalendar v5.0.6 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var core = require('@hebcal/core');
|
|
@@ -7,7 +7,7 @@ var restApi = require('@hebcal/rest-api');
|
|
|
7
7
|
var fs = require('fs');
|
|
8
8
|
|
|
9
9
|
// DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
10
|
-
const version = '5.0.
|
|
10
|
+
const version = '5.0.6';
|
|
11
11
|
|
|
12
12
|
const vtimezoneCache = new Map();
|
|
13
13
|
const CATEGORY = {
|
|
@@ -61,6 +61,9 @@ function appendTrackingToUrl(url, options) {
|
|
|
61
61
|
const encoder = new TextEncoder();
|
|
62
62
|
const char74re = /(.{1,74})/g;
|
|
63
63
|
|
|
64
|
+
const DAILY_LEARNING = core.flags.DAILY_LEARNING | core.flags.DAF_YOMI |
|
|
65
|
+
core.flags.MISHNA_YOMI | core.flags.YERUSHALMI_YOMI | core.flags.NACH_YOMI;
|
|
66
|
+
|
|
64
67
|
/**
|
|
65
68
|
* Represents an RFC 2445 iCalendar VEVENT
|
|
66
69
|
*/
|
|
@@ -81,21 +84,14 @@ class IcalEvent {
|
|
|
81
84
|
}
|
|
82
85
|
const timed = this.timed = Boolean(ev.eventTime);
|
|
83
86
|
const locale = options.locale;
|
|
87
|
+
const location = options.location;
|
|
84
88
|
let subj = restApi.shouldRenderBrief(ev) ? ev.renderBrief(locale) : ev.render(locale);
|
|
85
89
|
const mask = ev.getFlags();
|
|
86
90
|
if (ev.locationName) {
|
|
87
91
|
this.locationName = ev.locationName;
|
|
88
|
-
} else if (
|
|
89
|
-
this.locationName =
|
|
90
|
-
} else if (mask &
|
|
91
|
-
this.locationName = core.Locale.gettext('Yerushalmi Yomi', locale);
|
|
92
|
-
} else if (mask & core.flags.NACH_YOMI) {
|
|
93
|
-
this.locationName = core.Locale.gettext('Nach Yomi', locale);
|
|
94
|
-
} else if (mask & core.flags.MISHNA_YOMI) {
|
|
95
|
-
this.locationName = core.Locale.gettext('Mishna Yomi', locale);
|
|
96
|
-
} else if (timed && options.location) {
|
|
97
|
-
this.locationName = options.location.getShortName();
|
|
98
|
-
} else if (ev.category) {
|
|
92
|
+
} else if (timed && location) {
|
|
93
|
+
this.locationName = location.getShortName();
|
|
94
|
+
} else if ((mask & DAILY_LEARNING) && ev.category) {
|
|
99
95
|
this.locationName = core.Locale.gettext(ev.category, locale);
|
|
100
96
|
}
|
|
101
97
|
const date = IcalEvent.formatYYYYMMDD(ev.getDate().greg());
|
|
@@ -109,8 +105,8 @@ class IcalEvent {
|
|
|
109
105
|
minute = +minute;
|
|
110
106
|
this.startDate += 'T' + restApi.pad2(hour) + restApi.pad2(minute) + '00';
|
|
111
107
|
this.endDate = this.startDate;
|
|
112
|
-
if (
|
|
113
|
-
this.dtargs = `;TZID=${
|
|
108
|
+
if (location?.getTzid()) {
|
|
109
|
+
this.dtargs = `;TZID=${location.getTzid()}`;
|
|
114
110
|
}
|
|
115
111
|
} else {
|
|
116
112
|
this.endDate = IcalEvent.formatYYYYMMDD(ev.getDate().next().greg());
|
|
@@ -180,8 +176,8 @@ class IcalEvent {
|
|
|
180
176
|
const options = this.options;
|
|
181
177
|
const digest = murmurhash3.murmur32HexSync(this.ev.getDesc());
|
|
182
178
|
let uid = `hebcal-${this.isoDateOnly}-${digest}`;
|
|
183
|
-
|
|
184
|
-
|
|
179
|
+
const loc = options.location;
|
|
180
|
+
if (this.timed && loc) {
|
|
185
181
|
if (loc.getGeoId()) {
|
|
186
182
|
uid += `-${loc.getGeoId()}`;
|
|
187
183
|
} else if (loc.getName()) {
|
|
@@ -229,8 +225,9 @@ class IcalEvent {
|
|
|
229
225
|
const memo = createMemo(ev, options);
|
|
230
226
|
addOptional(arr, 'DESCRIPTION', memo);
|
|
231
227
|
addOptional(arr, 'LOCATION', this.locationName);
|
|
232
|
-
|
|
233
|
-
|
|
228
|
+
const loc = options.location;
|
|
229
|
+
if (this.timed && loc) {
|
|
230
|
+
arr.push('GEO:' + loc.getLatitude() + ';' + loc.getLongitude());
|
|
234
231
|
}
|
|
235
232
|
|
|
236
233
|
const trigger = this.getAlarm();
|
|
@@ -359,10 +356,9 @@ function eventToIcal(ev, options) {
|
|
|
359
356
|
|
|
360
357
|
const torahMemoCache = new Map();
|
|
361
358
|
|
|
362
|
-
const HOLIDAY_IGNORE_MASK =
|
|
359
|
+
const HOLIDAY_IGNORE_MASK = DAILY_LEARNING | core.flags.OMER_COUNT |
|
|
363
360
|
core.flags.SHABBAT_MEVARCHIM | core.flags.MOLAD | core.flags.USER_EVENT |
|
|
364
|
-
core.flags.
|
|
365
|
-
core.flags.HEBREW_DATE | core.flags.DAILY_LEARNING;
|
|
361
|
+
core.flags.HEBREW_DATE;
|
|
366
362
|
|
|
367
363
|
/**
|
|
368
364
|
* @private
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/*! @hebcal/icalendar v5.0.
|
|
1
|
+
/*! @hebcal/icalendar v5.0.6 */
|
|
2
2
|
import { flags, Locale, greg } from '@hebcal/core';
|
|
3
3
|
import { murmur32HexSync } from 'murmurhash3';
|
|
4
4
|
import { shouldRenderBrief, pad2, getEventCategories, makeAnchor, pad4, getHolidayDescription, getCalendarTitle, appendIsraelAndTracking, makeTorahMemoText } from '@hebcal/rest-api';
|
|
5
5
|
import { promises } from 'fs';
|
|
6
6
|
|
|
7
7
|
// DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
8
|
-
const version = '5.0.
|
|
8
|
+
const version = '5.0.6';
|
|
9
9
|
|
|
10
10
|
const vtimezoneCache = new Map();
|
|
11
11
|
const CATEGORY = {
|
|
@@ -59,6 +59,9 @@ function appendTrackingToUrl(url, options) {
|
|
|
59
59
|
const encoder = new TextEncoder();
|
|
60
60
|
const char74re = /(.{1,74})/g;
|
|
61
61
|
|
|
62
|
+
const DAILY_LEARNING = flags.DAILY_LEARNING | flags.DAF_YOMI |
|
|
63
|
+
flags.MISHNA_YOMI | flags.YERUSHALMI_YOMI | flags.NACH_YOMI;
|
|
64
|
+
|
|
62
65
|
/**
|
|
63
66
|
* Represents an RFC 2445 iCalendar VEVENT
|
|
64
67
|
*/
|
|
@@ -79,21 +82,14 @@ class IcalEvent {
|
|
|
79
82
|
}
|
|
80
83
|
const timed = this.timed = Boolean(ev.eventTime);
|
|
81
84
|
const locale = options.locale;
|
|
85
|
+
const location = options.location;
|
|
82
86
|
let subj = shouldRenderBrief(ev) ? ev.renderBrief(locale) : ev.render(locale);
|
|
83
87
|
const mask = ev.getFlags();
|
|
84
88
|
if (ev.locationName) {
|
|
85
89
|
this.locationName = ev.locationName;
|
|
86
|
-
} else if (
|
|
87
|
-
this.locationName =
|
|
88
|
-
} else if (mask &
|
|
89
|
-
this.locationName = Locale.gettext('Yerushalmi Yomi', locale);
|
|
90
|
-
} else if (mask & flags.NACH_YOMI) {
|
|
91
|
-
this.locationName = Locale.gettext('Nach Yomi', locale);
|
|
92
|
-
} else if (mask & flags.MISHNA_YOMI) {
|
|
93
|
-
this.locationName = Locale.gettext('Mishna Yomi', locale);
|
|
94
|
-
} else if (timed && options.location) {
|
|
95
|
-
this.locationName = options.location.getShortName();
|
|
96
|
-
} else if (ev.category) {
|
|
90
|
+
} else if (timed && location) {
|
|
91
|
+
this.locationName = location.getShortName();
|
|
92
|
+
} else if ((mask & DAILY_LEARNING) && ev.category) {
|
|
97
93
|
this.locationName = Locale.gettext(ev.category, locale);
|
|
98
94
|
}
|
|
99
95
|
const date = IcalEvent.formatYYYYMMDD(ev.getDate().greg());
|
|
@@ -107,8 +103,8 @@ class IcalEvent {
|
|
|
107
103
|
minute = +minute;
|
|
108
104
|
this.startDate += 'T' + pad2(hour) + pad2(minute) + '00';
|
|
109
105
|
this.endDate = this.startDate;
|
|
110
|
-
if (
|
|
111
|
-
this.dtargs = `;TZID=${
|
|
106
|
+
if (location?.getTzid()) {
|
|
107
|
+
this.dtargs = `;TZID=${location.getTzid()}`;
|
|
112
108
|
}
|
|
113
109
|
} else {
|
|
114
110
|
this.endDate = IcalEvent.formatYYYYMMDD(ev.getDate().next().greg());
|
|
@@ -178,8 +174,8 @@ class IcalEvent {
|
|
|
178
174
|
const options = this.options;
|
|
179
175
|
const digest = murmur32HexSync(this.ev.getDesc());
|
|
180
176
|
let uid = `hebcal-${this.isoDateOnly}-${digest}`;
|
|
181
|
-
|
|
182
|
-
|
|
177
|
+
const loc = options.location;
|
|
178
|
+
if (this.timed && loc) {
|
|
183
179
|
if (loc.getGeoId()) {
|
|
184
180
|
uid += `-${loc.getGeoId()}`;
|
|
185
181
|
} else if (loc.getName()) {
|
|
@@ -227,8 +223,9 @@ class IcalEvent {
|
|
|
227
223
|
const memo = createMemo(ev, options);
|
|
228
224
|
addOptional(arr, 'DESCRIPTION', memo);
|
|
229
225
|
addOptional(arr, 'LOCATION', this.locationName);
|
|
230
|
-
|
|
231
|
-
|
|
226
|
+
const loc = options.location;
|
|
227
|
+
if (this.timed && loc) {
|
|
228
|
+
arr.push('GEO:' + loc.getLatitude() + ';' + loc.getLongitude());
|
|
232
229
|
}
|
|
233
230
|
|
|
234
231
|
const trigger = this.getAlarm();
|
|
@@ -357,10 +354,9 @@ function eventToIcal(ev, options) {
|
|
|
357
354
|
|
|
358
355
|
const torahMemoCache = new Map();
|
|
359
356
|
|
|
360
|
-
const HOLIDAY_IGNORE_MASK =
|
|
357
|
+
const HOLIDAY_IGNORE_MASK = DAILY_LEARNING | flags.OMER_COUNT |
|
|
361
358
|
flags.SHABBAT_MEVARCHIM | flags.MOLAD | flags.USER_EVENT |
|
|
362
|
-
flags.
|
|
363
|
-
flags.HEBREW_DATE | flags.DAILY_LEARNING;
|
|
359
|
+
flags.HEBREW_DATE;
|
|
364
360
|
|
|
365
361
|
/**
|
|
366
362
|
* @private
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/icalendar",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.6",
|
|
4
4
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ical",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"url": "https://github.com/hebcal/hebcal-icalendar/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@hebcal/core": "^5.2.
|
|
33
|
+
"@hebcal/core": "^5.2.2",
|
|
34
34
|
"@hebcal/rest-api": "^5.0.3",
|
|
35
35
|
"murmurhash3": "^0.5.0"
|
|
36
36
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"license": "BSD-2-Clause",
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@hebcal/learning": "^5.0.
|
|
48
|
+
"@hebcal/learning": "^5.0.7",
|
|
49
49
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
50
50
|
"@rollup/plugin-json": "^6.1.0",
|
|
51
51
|
"ava": "^6.1.1",
|
|
@@ -53,6 +53,6 @@
|
|
|
53
53
|
"eslint-config-google": "^0.14.0",
|
|
54
54
|
"jsdoc": "^4.0.2",
|
|
55
55
|
"jsdoc-to-markdown": "^8.0.1",
|
|
56
|
-
"rollup": "^4.
|
|
56
|
+
"rollup": "^4.12.0"
|
|
57
57
|
}
|
|
58
58
|
}
|