Skip to content

Commit

Permalink
Fix timed Chanukah event URLs for previous year when final days are i…
Browse files Browse the repository at this point in the history
…n January
  • Loading branch information
mjradwin committed Jan 1, 2025
1 parent 987a20c commit b56c5bb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 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": "5.8.10",
"version": "5.8.11",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"contributors": [
"Eyal Schachter (https://github.com/Scimonster)",
Expand Down
4 changes: 2 additions & 2 deletions src/candles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {HDate, months} from '@hebcal/hdate';
import {CalOptions} from './CalOptions';
import {Location} from './location';
import {Event, flags} from './event';
import {HolidayEvent} from './HolidayEvent';
import {ChanukahEvent, HolidayEvent} from './HolidayEvent';
import {Zmanim} from './zmanim';
import {TimedEvent, CandleLightingEvent, HavdalahEvent} from './TimedEvent';

Expand Down Expand Up @@ -173,7 +173,7 @@ function makeTimedEvent(
return new TimedEvent(hd, desc, ev.getFlags(), time, location, ev, options);
}

export class TimedChanukahEvent extends HolidayEvent {
export class TimedChanukahEvent extends ChanukahEvent {
eventTime: Date;
eventTimeStr: string;
readonly location: Location;
Expand Down
20 changes: 20 additions & 0 deletions test/candles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,26 @@ test('chanukah-candles', () => {
expect(actual).toEqual(expected);
});

test('chanukah-candles-dec-jan', () => {
const options: CalOptions = {
start: new Date(2024, 11, 30),
end: new Date(2025, 0, 2),
location: Location.lookup('Providence'),
candlelighting: true,
};
const events = HebrewCalendar.calendar(options);
const urls = events
.filter((ev) => ev.basename() === 'Chanukah')
.map((ev) => ev.url());
const expected = [
'https://www.hebcal.com/holidays/chanukah-2024',
'https://www.hebcal.com/holidays/chanukah-2024',
'https://www.hebcal.com/holidays/chanukah-2024',
'https://www.hebcal.com/holidays/chanukah-2024',
];
expect(urls).toEqual(expected);
});

test('fastStartEnd-TzomTammuz', () => {
const events = HebrewCalendar.calendar({
start: new Date(2021, 5, 27),
Expand Down

0 comments on commit b56c5bb

Please sign in to comment.