Skip to content

Commit

Permalink
Render HebrewDateEvent as brief
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Oct 19, 2021
1 parent a2f632b commit bafe02b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/icalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function appendTrackingToUrl(url, options) {
}

const encoder = new TextEncoder();
const BRIEF_FLAGS = flags.DAF_YOMI | flags.HEBREW_DATE;

/**
* Represents an RFC 2445 iCalendar VEVENT
Expand All @@ -67,7 +68,8 @@ export class IcalEvent {
this.options = options;
this.dtstamp = options.dtstamp || IcalEvent.makeDtstamp(new Date());
const timed = this.timed = Boolean(ev.eventTime);
let subj = timed || (ev.getFlags() & flags.DAF_YOMI) ? ev.renderBrief() : ev.render();
const locale = options.locale;
let subj = timed || (ev.getFlags() & BRIEF_FLAGS) ? ev.renderBrief(locale) : ev.render(locale);
if (timed && options.location && options.location.name) {
const comma = options.location.name.indexOf(',');
this.locationName = (comma == -1) ? options.location.name : options.location.name.substring(0, comma);
Expand Down Expand Up @@ -322,7 +324,7 @@ function createMemo(e, options) {
} else {
let memo = e.memo || getHolidayDescription(e);
if (!memo && typeof e.linkedEvent !== 'undefined') {
memo = e.linkedEvent.render();
memo = e.linkedEvent.render(options.locale);
}
if (torahMemo) {
memo += '\\n\\n' + torahMemo;
Expand Down
2 changes: 1 addition & 1 deletion src/icalendar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ test('relcalid', async (t) => {
`X-WR-RELCALID:${relcalid}`,
'BEGIN:VEVENT',
'DTSTAMP:X',
'SUMMARY:1st of Adar\\, 5781',
'SUMMARY:1st of Adar',
'DTSTART;VALUE=DATE:20210213',
'DTEND;VALUE=DATE:20210214',
'UID:X',
Expand Down

0 comments on commit bafe02b

Please sign in to comment.