From 98e27caa74d3821a43154b239ff6b81f78d8463b Mon Sep 17 00:00:00 2001 From: "Michael J. Radwin" Date: Fri, 29 Oct 2021 12:55:36 -0700 Subject: [PATCH] Show Hebrew year in hebdate objects on the 1st of each month --- package.json | 6 +++--- src/icalendar.js | 6 +++--- src/icalendar.spec.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 39ecb4d..fc9b7f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hebcal/icalendar", - "version": "4.14.1", + "version": "4.14.2", "author": "Michael J. Radwin (https://github.com/mjradwin)", "keywords": [ "ical", @@ -24,8 +24,8 @@ "url": "https://github.com/hebcal/hebcal-icalendar/issues" }, "dependencies": { - "@hebcal/core": "^3.26.7", - "@hebcal/rest-api": "^3.8.4" + "@hebcal/core": "^3.27.0", + "@hebcal/rest-api": "^3.8.6" }, "scripts": { "build": "rollup -c", diff --git a/src/icalendar.js b/src/icalendar.js index a3d3604..a0a2e1a 100644 --- a/src/icalendar.js +++ b/src/icalendar.js @@ -1,7 +1,8 @@ import {flags, Locale} from '@hebcal/core'; import {murmur3} from 'murmurhash-js'; import {pad2, pad4, getCalendarTitle, makeAnchor, getEventCategories, - getHolidayDescription, makeTorahMemoText, appendIsraelAndTracking} from '@hebcal/rest-api'; + getHolidayDescription, makeTorahMemoText, appendIsraelAndTracking, + shouldRenderBrief} from '@hebcal/rest-api'; import {promises as fs} from 'fs'; import {version} from '../package.json'; @@ -52,7 +53,6 @@ function appendTrackingToUrl(url, options) { } const encoder = new TextEncoder(); -const BRIEF_FLAGS = flags.DAF_YOMI | flags.HEBREW_DATE; /** * Represents an RFC 2445 iCalendar VEVENT @@ -69,7 +69,7 @@ export class IcalEvent { this.dtstamp = options.dtstamp || IcalEvent.makeDtstamp(new Date()); const timed = this.timed = Boolean(ev.eventTime); const locale = options.locale; - let subj = timed || (ev.getFlags() & BRIEF_FLAGS) ? ev.renderBrief(locale) : ev.render(locale); + let subj = shouldRenderBrief(ev) ? ev.renderBrief(locale) : ev.render(locale); const mask = ev.getFlags(); if (ev.locationName) { this.locationName = ev.locationName; diff --git a/src/icalendar.spec.js b/src/icalendar.spec.js index 654c911..5095da0 100644 --- a/src/icalendar.spec.js +++ b/src/icalendar.spec.js @@ -413,7 +413,7 @@ test('relcalid', async (t) => { `X-WR-RELCALID:${relcalid}`, 'BEGIN:VEVENT', 'DTSTAMP:X', - 'SUMMARY:1st of Adar', + 'SUMMARY:1st of Adar\\, 5781', 'DTSTART;VALUE=DATE:20210213', 'DTEND;VALUE=DATE:20210214', 'UID:X',