Skip to content

Commit

Permalink
Render Hebrew version of wedding anniversary consistently with birthday
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Jun 20, 2024
1 parent e2e9d35 commit 7fb6ea9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/yahrzeit.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,14 +608,15 @@ function makeYahrzeitSubject(info, hd, yearNumber, appendHebDate) {
const isHebrewName = hebrewRe.test(name);
const type = info.type;
if (type !== 'Other') {
const isYahrzeit = type === 'Yahrzeit';
if (isHebrewName) {
const prefix = en2he[type];
subj = info.type === 'Birthday' ?
`${prefix} ${yearNumber} ל${name}` :
`${prefix} ה-${yearNumber} של ${name}`;
subj = isYahrzeit ?
`${prefix} ה-${yearNumber} של ${name}` :
`${prefix} ${yearNumber} ל${name}`;
} else {
const nth = Locale.ordinal(yearNumber, 'en');
const typeStr = type === 'Yahrzeit' ? type : `Hebrew ${type}`;
const typeStr = isYahrzeit ? type : `Hebrew ${type}`;
subj = `${name}’s ${nth} ${typeStr}`;
}
}
Expand Down

0 comments on commit 7fb6ea9

Please sign in to comment.