diff --git a/hebcal/all_holidays_test.go b/hebcal/all_holidays_test.go index 363af16..0125372 100644 --- a/hebcal/all_holidays_test.go +++ b/hebcal/all_holidays_test.go @@ -7,5 +7,5 @@ import ( ) func TestGetAllHolidaysForYear(t *testing.T) { - assert.Equal(t, 125, len(getAllHolidaysForYear(5783))) + assert.Equal(t, 126, len(getAllHolidaysForYear(5783))) } diff --git a/hebcal/hebcal_test.go b/hebcal/hebcal_test.go index 1ada755..95f0c6a 100644 --- a/hebcal/hebcal_test.go +++ b/hebcal/hebcal_test.go @@ -174,7 +174,7 @@ func TestHebrewCalendarChanukahCandles(t *testing.T) { } events, err := hebcal.HebrewCalendar(&opts) assert.Equal(nil, err) - assert.Equal(13, len(events)) + assert.Equal(14, len(events)) expected := []string{ "2022-12-18 Chanukah: 1 Candle: 5:04", "2022-12-19 Chanukah: 2 Candles: 5:05", @@ -183,6 +183,7 @@ func TestHebrewCalendarChanukahCandles(t *testing.T) { "2022-12-22 Chanukah: 5 Candles: 5:06", "2022-12-23 Chanukah: 6 Candles: 4:00", "2022-12-23 Candle lighting: 4:00", + "2022-12-24 Chag HaBanot", "2022-12-24 Chanukah: 7 Candles: 5:20", "2022-12-24 Rosh Chodesh Tevet", "2022-12-24 Havdalah: 5:20", @@ -388,6 +389,7 @@ func TestNoModern(t *testing.T) { "2022-12-21 Chanukah: 4 Candles", "2022-12-22 Chanukah: 5 Candles", "2022-12-23 Chanukah: 6 Candles", + "2022-12-24 Chag HaBanot", "2022-12-24 Chanukah: 7 Candles", "2022-12-25 Chanukah: 8 Candles", "2022-12-26 Chanukah: 8th Day", @@ -532,7 +534,7 @@ func TestYear2(t *testing.T) { } events, err := hebcal.HebrewCalendar(&opts) assert.Equal(t, nil, err) - assert.Equal(t, 126, len(events)) + assert.Equal(t, 127, len(events)) } func TestYear1(t *testing.T) { @@ -542,5 +544,5 @@ func TestYear1(t *testing.T) { } events, err := hebcal.HebrewCalendar(&opts) assert.Equal(t, nil, err) - assert.Equal(t, 78, len(events)) + assert.Equal(t, 79, len(events)) } diff --git a/hebcal/holidays.go b/hebcal/holidays.go index 3b7402c..85e152d 100644 --- a/hebcal/holidays.go +++ b/hebcal/holidays.go @@ -387,6 +387,13 @@ func getAllHolidaysForYear(year int) []event.HolidayEvent { Emoji: chanukahEmoji, ChanukahDay: 8}) + // On the 1st day of Rosh Chodesh Tevet + events = append(events, + event.HolidayEvent{ + Date: chanukah7, + Desc: "Chag HaBanot", + Flags: event.MINOR_HOLIDAY}) + // Tisha BAv and the 3 weeks var tamuz17 = hdate.New(year, hdate.Tamuz, 17) if tamuz17.Weekday() == time.Saturday { diff --git a/hebcal/holidays_test.go b/hebcal/holidays_test.go index 06fbb01..951fa10 100644 --- a/hebcal/holidays_test.go +++ b/hebcal/holidays_test.go @@ -12,7 +12,7 @@ import ( func TestGetHolidaysForYearArrayDiaspora(t *testing.T) { events := hebcal.GetHolidaysForYear(5771, false) - assert.Equal(t, 109, len(events)) + assert.Equal(t, 110, len(events)) expected := []string{ "2010-09-09 Rosh Hashana 5771", @@ -46,6 +46,7 @@ func TestGetHolidaysForYearArrayDiaspora(t *testing.T) { "2010-12-04 Shabbat Mevarchim Chodesh Tevet", "2010-12-05 Chanukah: 5 Candles", "2010-12-06 Chanukah: 6 Candles", + "2010-12-07 Chag HaBanot", "2010-12-07 Chanukah: 7 Candles", "2010-12-07 Rosh Chodesh Tevet", "2010-12-08 Chanukah: 8 Candles", @@ -137,7 +138,7 @@ func TestGetHolidaysForYearArrayDiaspora(t *testing.T) { func TestGetHolidaysForYearArrayIL(t *testing.T) { events := hebcal.GetHolidaysForYear(5720, true) - assert.Equal(t, 98, len(events)) + assert.Equal(t, 99, len(events)) expected := []string{ "1959-10-03 Rosh Hashana 5720", @@ -169,6 +170,7 @@ func TestGetHolidaysForYearArrayIL(t *testing.T) { "1959-12-28 Chanukah: 4 Candles", "1959-12-29 Chanukah: 5 Candles", "1959-12-30 Chanukah: 6 Candles", + "1959-12-31 Chag HaBanot", "1959-12-31 Chanukah: 7 Candles", "1959-12-31 Rosh Chodesh Tevet", "1960-01-01 Chanukah: 8 Candles", @@ -447,15 +449,15 @@ func TestHolidayEmoji(t *testing.T) { func TestHolidaysEarlyYears(t *testing.T) { events := hebcal.GetHolidaysForYear(3763, false) - assert.Equal(t, 97, len(events)) + assert.Equal(t, 98, len(events)) events = hebcal.GetHolidaysForYear(3762, false) - assert.Equal(t, 103, len(events)) + assert.Equal(t, 104, len(events)) events = hebcal.GetHolidaysForYear(3761, false) - assert.Equal(t, 98, len(events)) + assert.Equal(t, 99, len(events)) events = hebcal.GetHolidaysForYear(3760, false) - assert.Equal(t, 104, len(events)) + assert.Equal(t, 105, len(events)) events = hebcal.GetHolidaysForYear(2, false) - assert.Equal(t, 98, len(events)) + assert.Equal(t, 99, len(events)) events = hebcal.GetHolidaysForYear(1, false) - assert.Equal(t, 98, len(events)) + assert.Equal(t, 99, len(events)) }