@hebcal/icalendar 5.0.3 → 5.0.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/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/icalendar v5.0.3 */
1
+ /*! @hebcal/icalendar v5.0.5 */
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.3';
10
+ const version = '5.0.5';
11
11
 
12
12
  const vtimezoneCache = new Map();
13
13
  const CATEGORY = {
@@ -86,15 +86,17 @@ class IcalEvent {
86
86
  if (ev.locationName) {
87
87
  this.locationName = ev.locationName;
88
88
  } else if (mask & core.flags.DAF_YOMI) {
89
- this.locationName = core.Locale.gettext('Daf Yomi');
89
+ this.locationName = core.Locale.gettext('Daf Yomi', locale);
90
90
  } else if (mask & core.flags.YERUSHALMI_YOMI) {
91
- this.locationName = core.Locale.gettext('Yerushalmi Yomi');
91
+ this.locationName = core.Locale.gettext('Yerushalmi Yomi', locale);
92
92
  } else if (mask & core.flags.NACH_YOMI) {
93
- this.locationName = core.Locale.gettext('Nach Yomi');
93
+ this.locationName = core.Locale.gettext('Nach Yomi', locale);
94
94
  } else if (mask & core.flags.MISHNA_YOMI) {
95
- this.locationName = core.Locale.gettext('Mishna Yomi');
95
+ this.locationName = core.Locale.gettext('Mishna Yomi', locale);
96
96
  } else if (timed && options.location) {
97
97
  this.locationName = options.location.getShortName();
98
+ } else if (ev.category) {
99
+ this.locationName = core.Locale.gettext(ev.category, locale);
98
100
  }
99
101
  const date = IcalEvent.formatYYYYMMDD(ev.getDate().greg());
100
102
  this.startDate = this.isoDateOnly = date;
@@ -360,7 +362,7 @@ const torahMemoCache = new Map();
360
362
  const HOLIDAY_IGNORE_MASK = core.flags.DAF_YOMI | core.flags.OMER_COUNT |
361
363
  core.flags.SHABBAT_MEVARCHIM | core.flags.MOLAD | core.flags.USER_EVENT |
362
364
  core.flags.MISHNA_YOMI | core.flags.YERUSHALMI_YOMI | core.flags.NACH_YOMI |
363
- core.flags.HEBREW_DATE;
365
+ core.flags.HEBREW_DATE | core.flags.DAILY_LEARNING;
364
366
 
365
367
  /**
366
368
  * @private
@@ -456,7 +458,8 @@ async function eventsToIcalendar(events, options) {
456
458
  */
457
459
  async function icalEventsToString(icals, options) {
458
460
  const stream = [];
459
- const uclang = core.Locale.getLocaleName().toUpperCase();
461
+ const locale = options.locale || core.Locale.getLocaleName();
462
+ const uclang = locale.toUpperCase();
460
463
  const opts = Object.assign({}, options);
461
464
  opts.dtstamp = opts.dtstamp || IcalEvent.makeDtstamp(new Date());
462
465
  const title = opts.title ? IcalEvent.escape(opts.title) : 'Untitled';
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- /*! @hebcal/icalendar v5.0.3 */
1
+ /*! @hebcal/icalendar v5.0.5 */
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.3';
8
+ const version = '5.0.5';
9
9
 
10
10
  const vtimezoneCache = new Map();
11
11
  const CATEGORY = {
@@ -84,15 +84,17 @@ class IcalEvent {
84
84
  if (ev.locationName) {
85
85
  this.locationName = ev.locationName;
86
86
  } else if (mask & flags.DAF_YOMI) {
87
- this.locationName = Locale.gettext('Daf Yomi');
87
+ this.locationName = Locale.gettext('Daf Yomi', locale);
88
88
  } else if (mask & flags.YERUSHALMI_YOMI) {
89
- this.locationName = Locale.gettext('Yerushalmi Yomi');
89
+ this.locationName = Locale.gettext('Yerushalmi Yomi', locale);
90
90
  } else if (mask & flags.NACH_YOMI) {
91
- this.locationName = Locale.gettext('Nach Yomi');
91
+ this.locationName = Locale.gettext('Nach Yomi', locale);
92
92
  } else if (mask & flags.MISHNA_YOMI) {
93
- this.locationName = Locale.gettext('Mishna Yomi');
93
+ this.locationName = Locale.gettext('Mishna Yomi', locale);
94
94
  } else if (timed && options.location) {
95
95
  this.locationName = options.location.getShortName();
96
+ } else if (ev.category) {
97
+ this.locationName = Locale.gettext(ev.category, locale);
96
98
  }
97
99
  const date = IcalEvent.formatYYYYMMDD(ev.getDate().greg());
98
100
  this.startDate = this.isoDateOnly = date;
@@ -358,7 +360,7 @@ const torahMemoCache = new Map();
358
360
  const HOLIDAY_IGNORE_MASK = flags.DAF_YOMI | flags.OMER_COUNT |
359
361
  flags.SHABBAT_MEVARCHIM | flags.MOLAD | flags.USER_EVENT |
360
362
  flags.MISHNA_YOMI | flags.YERUSHALMI_YOMI | flags.NACH_YOMI |
361
- flags.HEBREW_DATE;
363
+ flags.HEBREW_DATE | flags.DAILY_LEARNING;
362
364
 
363
365
  /**
364
366
  * @private
@@ -454,7 +456,8 @@ async function eventsToIcalendar(events, options) {
454
456
  */
455
457
  async function icalEventsToString(icals, options) {
456
458
  const stream = [];
457
- const uclang = Locale.getLocaleName().toUpperCase();
459
+ const locale = options.locale || Locale.getLocaleName();
460
+ const uclang = locale.toUpperCase();
458
461
  const opts = Object.assign({}, options);
459
462
  opts.dtstamp = opts.dtstamp || IcalEvent.makeDtstamp(new Date());
460
463
  const title = opts.title ? IcalEvent.escape(opts.title) : 'Untitled';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/icalendar",
3
- "version": "5.0.3",
3
+ "version": "5.0.5",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "keywords": [
6
6
  "ical",
@@ -14,7 +14,8 @@
14
14
  "type": "module",
15
15
  "exports": {
16
16
  "import": "./dist/index.mjs",
17
- "require": "./dist/index.cjs"
17
+ "require": "./dist/index.cjs",
18
+ "types": "./icalendar.d.ts"
18
19
  },
19
20
  "typings": "icalendar.d.ts",
20
21
  "files": [
@@ -29,8 +30,8 @@
29
30
  "url": "https://github.com/hebcal/hebcal-icalendar/issues"
30
31
  },
31
32
  "dependencies": {
32
- "@hebcal/core": "^5.0.8",
33
- "@hebcal/rest-api": "^5.0.2",
33
+ "@hebcal/core": "^5.2.1",
34
+ "@hebcal/rest-api": "^5.0.3",
34
35
  "murmurhash3": "^0.5.0"
35
36
  },
36
37
  "scripts": {
@@ -44,14 +45,14 @@
44
45
  },
45
46
  "license": "BSD-2-Clause",
46
47
  "devDependencies": {
47
- "@hebcal/learning": "^5.0.2",
48
+ "@hebcal/learning": "^5.0.6",
48
49
  "@rollup/plugin-commonjs": "^25.0.7",
49
50
  "@rollup/plugin-json": "^6.1.0",
50
- "ava": "^6.0.1",
51
+ "ava": "^6.1.1",
51
52
  "eslint": "^8.56.0",
52
53
  "eslint-config-google": "^0.14.0",
53
54
  "jsdoc": "^4.0.2",
54
- "jsdoc-to-markdown": "^8.0.0",
55
- "rollup": "^4.9.5"
55
+ "jsdoc-to-markdown": "^8.0.1",
56
+ "rollup": "^4.9.6"
56
57
  }
57
58
  }