Skip to content

Commit

Permalink
Use smart-apostrophe for holiday and date render
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Jan 12, 2024
1 parent 6049f0f commit c7bec3c
Show file tree
Hide file tree
Showing 11 changed files with 136 additions and 81 deletions.
114 changes: 57 additions & 57 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/core",
"version": "5.0.7",
"version": "5.0.8",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"contributors": [
"Eyal Schachter (https://github.com/Scimonster)",
Expand Down Expand Up @@ -72,7 +72,7 @@
},
"devDependencies": {
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.7",
"@babel/preset-env": "^7.23.8",
"@babel/register": "^7.23.7",
"@hebcal/hdate": "^0.9.1",
"@hebcal/noaa": "^0.8.11",
Expand All @@ -89,7 +89,7 @@
"jsdoc-to-markdown": "^8.0.0",
"nyc": "^15.1.0",
"quick-lru": "^7.0.0",
"rollup": "^4.9.2",
"rollup": "^4.9.5",
"ttag-cli": "^1.10.10"
}
}
18 changes: 9 additions & 9 deletions po/ashkenazi.po
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ msgid "Bechukotai"
msgstr "Bechukosai"

msgid "Beha'alotcha"
msgstr "Beha'aloscha"
msgstr "Behaaloscha"

msgid "Bereshit"
msgstr "Bereshis"
Expand Down Expand Up @@ -110,28 +110,28 @@ msgid "Sukkot II"
msgstr "Sukkos II"

msgid "Sukkot II (CH''M)"
msgstr "Sukkos II (CH''M)"
msgstr "Sukkos II (CH’’M)"

msgid "Sukkot III (CH''M)"
msgstr "Sukkos III (CH''M)"
msgstr "Sukkos III (CH’’M)"

msgid "Sukkot IV (CH''M)"
msgstr "Sukkos IV (CH''M)"
msgstr "Sukkos IV (CH’’M)"

msgid "Sukkot V (CH''M)"
msgstr "Sukkos V (CH''M)"
msgstr "Sukkos V (CH’’M)"

msgid "Sukkot VI (CH''M)"
msgstr "Sukkos VI (CH''M)"
msgstr "Sukkos VI (CH’’M)"

msgid "Sukkot VII (Hoshana Raba)"
msgstr "Sukkos VII (Hoshana Raba)"

msgid "Ta'anit Bechorot"
msgstr "Ta'anis Bechoros"
msgstr "Taanis Bechoros"

msgid "Ta'anit Esther"
msgstr "Ta'anis Esther"
msgstr "Taanis Esther"

msgid "Toldot"
msgstr "Toldos"
Expand Down Expand Up @@ -161,7 +161,7 @@ msgid "Tevet"
msgstr "Teves"

msgid "Asara B'Tevet"
msgstr "Asara B'Teves"
msgstr "Asara BTeves"

# hebcal/hebcal zmanim (unused by hebcal/hebcal-es6)
msgid "Alot HaShachar"
Expand Down
3 changes: 2 additions & 1 deletion src/hdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ export class HDate {
render(locale=null, showYear=true) {
const locale0 = locale || Locale.getLocaleName();
const day = this.getDate();
const monthName = Locale.gettext(this.getMonthName(), locale0);
const monthName0 = Locale.gettext(this.getMonthName(), locale0);
const monthName = monthName0.replace(/'/g, '’');
const nth = Locale.ordinal(day, locale0);
const dayOf = HDate.getDayOfTranslation(locale0);
const dateStr = `${nth}${dayOf} ${monthName}`;
Expand Down
15 changes: 15 additions & 0 deletions src/hdate.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,21 @@ test('render', (t) => {
t.is(hd.render('he', false), '15 חֶשְׁוָן');
});

test('render-shvat', (t) => {
const hd = new HDate(15, months.SHVAT, 5789);
t.is(hd.render(''), '15th of Sh’vat, 5789');
t.is(hd.render('en'), '15th of Sh’vat, 5789');
t.is(hd.render('s'), '15th of Sh’vat, 5789');
t.is(hd.render('ashkenazi'), '15th of Sh’vat, 5789');

t.is(hd.render('en', true), '15th of Sh’vat, 5789');
t.is(hd.render('ashkenazi', true), '15th of Sh’vat, 5789');

t.is(hd.render('en', false), '15th of Sh’vat');
t.is(hd.render('ashkenazi', false), '15th of Sh’vat');
});


test('render-tevet-ashkenazi', (t) => {
const hd = new HDate(3, months.TEVET, 5769);
t.is(hd.render('en', false), '3rd of Tevet');
Expand Down
2 changes: 1 addition & 1 deletion src/hebcal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ test('renderBrief', (t) => {
['Parashat Tetzaveh', 'פָּרָשַׁת תְּצַוֶּה'],
['Havdalah', 'הַבְדָּלָה'],
['Fast begins', 'תחילת הַצוֹם'],
['Ta\'anit Esther', 'תַּעֲנִית אֶסְתֵּר'],
['Taanit Esther', 'תַּעֲנִית אֶסְתֵּר'],
['Fast ends', 'סִיּוּם הַצוֹם'],
['Erev Purim', 'עֶרֶב פּוּרִים'],
['Purim', 'פּוּרִים'],
Expand Down
Loading

0 comments on commit c7bec3c

Please sign in to comment.