Skip to content

Commit

Permalink
Use Gregorian date for Holiday URL suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Sep 6, 2020
1 parent cf51690 commit 08b17c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/core",
"version": "2.5.0",
"version": "2.5.1",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"contributors": [
"Eyal Schachter (https://github.com/Scimonster)",
Expand Down
2 changes: 1 addition & 1 deletion src/holidays.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class HolidayEvent extends Event {
url() {
return 'https://www.hebcal.com/holidays/' +
this.basename().toLowerCase().replace(/'/g, '').replace(/ /g, '-') + '-' +
this.getDate().getFullYear();
this.getDate().greg().getFullYear();
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/holidays.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,30 @@ test('basename-and-url', (t) => {
t.is(ev.render(), 'Pesach IV (CH\'\'M)');
t.is(ev.renderBrief(), 'Pesach IV (CH\'\'M)');
t.is(ev.basename(), 'Pesach');
t.is(ev.url(), 'https://www.hebcal.com/holidays/pesach-5763');
t.is(ev.url(), 'https://www.hebcal.com/holidays/pesach-2003');

const ev2 = new HolidayEvent(new HDate(23, months.TISHREI, 5763),
'Simchat Torah', flags.CHUL_ONLY);
t.is(ev2.getDesc(), 'Simchat Torah');
t.is(ev2.render(), 'Simchat Torah');
t.is(ev2.renderBrief(), 'Simchat Torah');
t.is(ev2.basename(), 'Simchat Torah');
t.is(ev2.url(), 'https://www.hebcal.com/holidays/simchat-torah-5763');
t.is(ev2.url(), 'https://www.hebcal.com/holidays/simchat-torah-2002');

const ev3 = new HolidayEvent(new HDate(8, months.AV, 5783),
'Erev Tish\'a B\'Av', flags.MAJOR_FAST);
t.is(ev3.getDesc(), 'Erev Tish\'a B\'Av');
t.is(ev3.render(), 'Erev Tish\'a B\'Av');
t.is(ev3.renderBrief(), 'Erev Tish\'a B\'Av');
t.is(ev3.basename(), 'Tish\'a B\'Av');
t.is(ev3.url(), 'https://www.hebcal.com/holidays/tisha-bav-5783');
t.is(ev3.url(), 'https://www.hebcal.com/holidays/tisha-bav-2023');

const rch = new RoshChodeshEvent(new HDate(30, months.ADAR_I, 5787), 'Adar II');
t.is(rch.getDesc(), 'Rosh Chodesh Adar II');
t.is(rch.render(), 'Rosh Chodesh Adar II');
t.is(rch.renderBrief(), 'Rosh Chodesh Adar II');
t.is(rch.basename(), 'Rosh Chodesh Adar II');
t.is(rch.url(), 'https://www.hebcal.com/holidays/rosh-chodesh-adar-ii-5787');
t.is(rch.url(), 'https://www.hebcal.com/holidays/rosh-chodesh-adar-ii-2027');

const mvch = new MevarchimChodeshEvent(new HDate(23, months.KISLEV, 5769), 'Tevet');
t.is(mvch.getDesc(), 'Shabbat Mevarchim Chodesh Tevet');
Expand Down

0 comments on commit 08b17c8

Please sign in to comment.