diff --git a/dafyomi/dafyomi_test.go b/dafyomi/dafyomi_test.go index 1c8f2f7..479c982 100644 --- a/dafyomi/dafyomi_test.go +++ b/dafyomi/dafyomi_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/dafyomi" + "github.com/MaxBGreenberg/hebcal-go/dafyomi" "github.com/stretchr/testify/assert" ) diff --git a/event/dafyomi.go b/event/dafyomi.go index b8ca4f0..4285252 100644 --- a/event/dafyomi.go +++ b/event/dafyomi.go @@ -5,8 +5,8 @@ import ( "github.com/hebcal/gematriya" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/dafyomi" - "github.com/hebcal/hebcal-go/locales" + "github.com/MaxBGreenberg/hebcal-go/dafyomi" + "github.com/MaxBGreenberg/hebcal-go/locales" ) type dafYomiEvent struct { diff --git a/event/event_test.go b/event/event_test.go index cfba106..986c9f0 100644 --- a/event/event_test.go +++ b/event/event_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/event" - "github.com/hebcal/hebcal-go/sedra" + "github.com/MaxBGreenberg/hebcal-go/event" + "github.com/MaxBGreenberg/hebcal-go/sedra" "github.com/stretchr/testify/assert" ) diff --git a/event/hdate.go b/event/hdate.go index 58e60ef..6d627f5 100644 --- a/event/hdate.go +++ b/event/hdate.go @@ -6,7 +6,7 @@ import ( "github.com/dustin/go-humanize" "github.com/hebcal/gematriya" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/locales" + "github.com/MaxBGreenberg/hebcal-go/locales" ) type hebrewDateEvent struct { diff --git a/event/holiday.go b/event/holiday.go index 2226351..eab86a7 100644 --- a/event/holiday.go +++ b/event/holiday.go @@ -4,7 +4,7 @@ import ( "regexp" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/locales" + "github.com/MaxBGreenberg/hebcal-go/locales" ) // HolidayEvent represents a built-in holiday like Pesach, Purim or Tu BiShvat diff --git a/event/molad.go b/event/molad.go index cd45200..6307b3a 100644 --- a/event/molad.go +++ b/event/molad.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/locales" - "github.com/hebcal/hebcal-go/molad" + "github.com/MaxBGreenberg/hebcal-go/locales" + "github.com/MaxBGreenberg/hebcal-go/molad" ) type moladEvent struct { diff --git a/event/myomi.go b/event/myomi.go index 444fdd4..8a608bc 100644 --- a/event/myomi.go +++ b/event/myomi.go @@ -4,8 +4,8 @@ import ( "strconv" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/locales" - "github.com/hebcal/hebcal-go/mishnayomi" + "github.com/MaxBGreenberg/hebcal-go/locales" + "github.com/MaxBGreenberg/hebcal-go/mishnayomi" ) type mishnaYomiEvent struct { diff --git a/event/nachyomi.go b/event/nachyomi.go index ca5aa2f..fa04b8a 100644 --- a/event/nachyomi.go +++ b/event/nachyomi.go @@ -5,8 +5,8 @@ import ( "github.com/hebcal/gematriya" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/dafyomi" - "github.com/hebcal/hebcal-go/locales" + "github.com/MaxBGreenberg/hebcal-go/dafyomi" + "github.com/MaxBGreenberg/hebcal-go/locales" ) type nachYomiEvent struct { diff --git a/event/parsha.go b/event/parsha.go index 5430f83..20dc1be 100644 --- a/event/parsha.go +++ b/event/parsha.go @@ -4,8 +4,8 @@ import ( "strings" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/locales" - "github.com/hebcal/hebcal-go/sedra" + "github.com/MaxBGreenberg/hebcal-go/locales" + "github.com/MaxBGreenberg/hebcal-go/sedra" ) // Represents one of 54 weekly Torah portions, always on a Saturday diff --git a/event/yyomi.go b/event/yyomi.go index af1081e..ec01370 100644 --- a/event/yyomi.go +++ b/event/yyomi.go @@ -5,8 +5,8 @@ import ( "github.com/hebcal/gematriya" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/dafyomi" - "github.com/hebcal/hebcal-go/locales" + "github.com/MaxBGreenberg/hebcal-go/dafyomi" + "github.com/MaxBGreenberg/hebcal-go/locales" ) type yyomiEvent struct { diff --git a/go.mod b/go.mod index 29aa221..66952a3 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,18 @@ -module github.com/hebcal/hebcal-go +module github.com/MaxBGreenberg/hebcal-go go 1.13 -require github.com/stretchr/testify v1.8.1 - require ( github.com/dustin/go-humanize v1.0.1 github.com/hebcal/gematriya v1.0.1 github.com/hebcal/greg v1.0.0 github.com/hebcal/hdate v1.0.2 github.com/nathan-osman/go-sunrise v1.1.0 + github.com/stretchr/testify v1.8.4 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f442315..5ed767a 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,9 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/hebcal/candles.go b/hebcal/candles.go index 2555544..9e69811 100644 --- a/hebcal/candles.go +++ b/hebcal/candles.go @@ -22,9 +22,9 @@ import ( "time" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/event" - "github.com/hebcal/hebcal-go/locales" - "github.com/hebcal/hebcal-go/zmanim" + "github.com/MaxBGreenberg/hebcal-go/event" + "github.com/MaxBGreenberg/hebcal-go/locales" + "github.com/MaxBGreenberg/hebcal-go/zmanim" ) func formatTime(t *time.Time, opts *CalOptions) string { @@ -162,7 +162,7 @@ func makeChanukahCandleLighting(ev event.HolidayEvent, opts *CalOptions) TimedEv year, month, day := hd.Greg() gregDate := time.Date(year, month, day, 0, 0, 0, 0, time.UTC) z := zmanim.New(loc, gregDate) - candleLightingTime := z.Dusk() + candleLightingTime := z.Tzeit(zmanim.Tzeit3MediumStars) if (candleLightingTime == time.Time{}) { return TimedEvent{} // no sunset } @@ -243,21 +243,23 @@ func dailyZemanim(date hdate.HDate, opts *CalOptions) []event.CalEvent { t time.Time }{ {"Alot haShachar", z.AlotHaShachar()}, - {"Misheyakir", z.Misheyakir()}, - {"Misheyakir Machmir", z.MisheyakirMachmir()}, - {"Dawn", z.Dawn()}, + //{"Misheyakir", z.Misheyakir()}, + {"Misheyakir", z.MisheyakirMachmir()}, + //{"Dawn", z.Dawn()}, {"Sunrise", z.Sunrise()}, - {"Kriat Shema, sof zeman", z.SofZmanShma()}, {"Kriat Shema, sof zeman (MGA)", z.SofZmanShmaMGA()}, - {"Tefilah, sof zeman", z.SofZmanTfilla()}, + {"Kriat Shema, sof zeman (GRA)", z.SofZmanShma()}, {"Tefilah, sof zeman (MGA)", z.SofZmanTfillaMGA()}, + {"Tefilah, sof zeman (GRA)", z.SofZmanTfilla()}, {"Chatzot hayom", z.Chatzot()}, {"Mincha Gedolah", z.MinchaGedola()}, {"Mincha Ketanah", z.MinchaKetana()}, {"Plag HaMincha", z.PlagHaMincha()}, {"Sunset", z.Sunset()}, - {"Dusk", z.Dusk()}, - {"Tzeit HaKochavim", z.Tzeit(zmanim.Tzeit3SmallStars)}, + {"Bein HaShemashot", z.BeinHashmashos()}, + //{"Dusk", z.Dusk()}, + {"Tzeit HaKochavim", z.Tzeit(zmanim.Tzeit3MediumStars)}, + {"Chatzoz Halayla", z.ChatzotNight()}, } events := make([]event.CalEvent, 0, len(times)) for _, zman := range times { diff --git a/hebcal/hebcal.go b/hebcal/hebcal.go index 064f4ba..5b4abcf 100644 --- a/hebcal/hebcal.go +++ b/hebcal/hebcal.go @@ -24,15 +24,15 @@ import ( "github.com/hebcal/greg" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/dafyomi" - "github.com/hebcal/hebcal-go/event" - "github.com/hebcal/hebcal-go/mishnayomi" - "github.com/hebcal/hebcal-go/molad" - "github.com/hebcal/hebcal-go/nachyomi" - "github.com/hebcal/hebcal-go/omer" - "github.com/hebcal/hebcal-go/sedra" - "github.com/hebcal/hebcal-go/yerushalmi" - "github.com/hebcal/hebcal-go/zmanim" + "github.com/MaxBGreenberg/hebcal-go/dafyomi" + "github.com/MaxBGreenberg/hebcal-go/event" + "github.com/MaxBGreenberg/hebcal-go/mishnayomi" + "github.com/MaxBGreenberg/hebcal-go/molad" + "github.com/MaxBGreenberg/hebcal-go/nachyomi" + "github.com/MaxBGreenberg/hebcal-go/omer" + "github.com/MaxBGreenberg/hebcal-go/sedra" + "github.com/MaxBGreenberg/hebcal-go/yerushalmi" + "github.com/MaxBGreenberg/hebcal-go/zmanim" ) /* diff --git a/hebcal/hebcal_test.go b/hebcal/hebcal_test.go index 49c84cc..a884c92 100644 --- a/hebcal/hebcal_test.go +++ b/hebcal/hebcal_test.go @@ -7,10 +7,10 @@ import ( "time" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/event" - "github.com/hebcal/hebcal-go/hebcal" - "github.com/hebcal/hebcal-go/yerushalmi" - "github.com/hebcal/hebcal-go/zmanim" + "github.com/MaxBGreenberg/hebcal-go/event" + "github.com/MaxBGreenberg/hebcal-go/hebcal" + "github.com/MaxBGreenberg/hebcal-go/yerushalmi" + "github.com/MaxBGreenberg/hebcal-go/zmanim" "github.com/stretchr/testify/assert" ) @@ -421,10 +421,10 @@ func TestDailyZemanim(t *testing.T) { "2021-11-27 Misheyakir Machmir: 05:54", "2021-11-27 Dawn: 06:18", "2021-11-27 Sunrise: 06:49", - "2021-11-27 Kriat Shema, sof zeman: 09:11", "2021-11-27 Kriat Shema, sof zeman (MGA): 08:35", - "2021-11-27 Tefilah, sof zeman: 09:58", + "2021-11-27 Kriat Shema, sof zeman (GRA): 09:11", "2021-11-27 Tefilah, sof zeman (MGA): 09:34", + "2021-11-27 Tefilah, sof zeman (GRA): 09:58", "2021-11-27 Chatzot hayom: 11:33", "2021-11-27 Mincha Gedolah: 11:57", "2021-11-27 Mincha Ketanah: 14:19", diff --git a/hebcal/holidays.go b/hebcal/holidays.go index 85e152d..280bf11 100644 --- a/hebcal/holidays.go +++ b/hebcal/holidays.go @@ -23,8 +23,8 @@ import ( "time" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/event" - "github.com/hebcal/hebcal-go/sedra" + "github.com/MaxBGreenberg/hebcal-go/event" + "github.com/MaxBGreenberg/hebcal-go/sedra" ) type holiday struct { diff --git a/hebcal/holidays_test.go b/hebcal/holidays_test.go index 951fa10..4e383c6 100644 --- a/hebcal/holidays_test.go +++ b/hebcal/holidays_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/event" - "github.com/hebcal/hebcal-go/hebcal" + "github.com/MaxBGreenberg/hebcal-go/event" + "github.com/MaxBGreenberg/hebcal-go/hebcal" "github.com/stretchr/testify/assert" ) diff --git a/hebcal/nachyomi_test.go b/hebcal/nachyomi_test.go index 1c8749c..dcfcc9e 100644 --- a/hebcal/nachyomi_test.go +++ b/hebcal/nachyomi_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/hebcal" + "github.com/MaxBGreenberg/hebcal-go/hebcal" "github.com/stretchr/testify/assert" ) diff --git a/hebcal/options.go b/hebcal/options.go index b4caa6d..e6edddc 100644 --- a/hebcal/options.go +++ b/hebcal/options.go @@ -20,9 +20,9 @@ import ( "time" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/event" - "github.com/hebcal/hebcal-go/yerushalmi" - "github.com/hebcal/hebcal-go/zmanim" + "github.com/MaxBGreenberg/hebcal-go/event" + "github.com/MaxBGreenberg/hebcal-go/yerushalmi" + "github.com/MaxBGreenberg/hebcal-go/zmanim" ) // UserEvent is used for generating a non-yahrtzeit user event. diff --git a/mishnayomi/myomi_test.go b/mishnayomi/myomi_test.go index a77eba9..e537e7a 100644 --- a/mishnayomi/myomi_test.go +++ b/mishnayomi/myomi_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/mishnayomi" + "github.com/MaxBGreenberg/hebcal-go/mishnayomi" "github.com/stretchr/testify/assert" ) diff --git a/molad/molad_test.go b/molad/molad_test.go index d839942..8cac7b7 100644 --- a/molad/molad_test.go +++ b/molad/molad_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/event" - "github.com/hebcal/hebcal-go/molad" + "github.com/MaxBGreenberg/hebcal-go/event" + "github.com/MaxBGreenberg/hebcal-go/molad" "github.com/stretchr/testify/assert" ) diff --git a/nachyomi/nachyomi.go b/nachyomi/nachyomi.go index e53fcc2..244329c 100644 --- a/nachyomi/nachyomi.go +++ b/nachyomi/nachyomi.go @@ -26,7 +26,7 @@ import ( "github.com/hebcal/greg" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/dafyomi" + "github.com/MaxBGreenberg/hebcal-go/dafyomi" ) // Nach Yomi takes slightly longer than two years, diff --git a/nachyomi/nachyomi_test.go b/nachyomi/nachyomi_test.go index 38cc8bb..03a7c99 100644 --- a/nachyomi/nachyomi_test.go +++ b/nachyomi/nachyomi_test.go @@ -7,8 +7,8 @@ import ( "time" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/dafyomi" - "github.com/hebcal/hebcal-go/nachyomi" + "github.com/MaxBGreenberg/hebcal-go/dafyomi" + "github.com/MaxBGreenberg/hebcal-go/nachyomi" "github.com/stretchr/testify/assert" ) diff --git a/omer/omer.go b/omer/omer.go index d1e1fdd..51d348d 100644 --- a/omer/omer.go +++ b/omer/omer.go @@ -24,8 +24,8 @@ import ( "github.com/dustin/go-humanize" "github.com/hebcal/gematriya" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/event" - "github.com/hebcal/hebcal-go/locales" + "github.com/MaxBGreenberg/hebcal-go/event" + "github.com/MaxBGreenberg/hebcal-go/locales" ) type OmerEvent struct { diff --git a/omer/omer_test.go b/omer/omer_test.go index 860169e..a507780 100644 --- a/omer/omer_test.go +++ b/omer/omer_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/omer" + "github.com/MaxBGreenberg/hebcal-go/omer" "github.com/stretchr/testify/assert" ) diff --git a/sedra/sedra_test.go b/sedra/sedra_test.go index 79a9be3..e6ef07d 100644 --- a/sedra/sedra_test.go +++ b/sedra/sedra_test.go @@ -6,7 +6,7 @@ import ( "time" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/sedra" + "github.com/MaxBGreenberg/hebcal-go/sedra" "github.com/stretchr/testify/assert" ) diff --git a/yerushalmi/yyomi.go b/yerushalmi/yyomi.go index 04194d9..59deb51 100644 --- a/yerushalmi/yyomi.go +++ b/yerushalmi/yyomi.go @@ -9,7 +9,7 @@ import ( "github.com/hebcal/greg" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/dafyomi" + "github.com/MaxBGreenberg/hebcal-go/dafyomi" ) // Using the Vilna edition, the Yerushalmi Daf Yomi program takes diff --git a/yerushalmi/yyomi_test.go b/yerushalmi/yyomi_test.go index 09fa159..6fe3dba 100644 --- a/yerushalmi/yyomi_test.go +++ b/yerushalmi/yyomi_test.go @@ -6,8 +6,8 @@ import ( "time" "github.com/hebcal/hdate" - "github.com/hebcal/hebcal-go/dafyomi" - "github.com/hebcal/hebcal-go/yerushalmi" + "github.com/MaxBGreenberg/hebcal-go/dafyomi" + "github.com/MaxBGreenberg/hebcal-go/yerushalmi" "github.com/stretchr/testify/assert" ) diff --git a/zmanim/location_test.go b/zmanim/location_test.go index 0466395..792041e 100644 --- a/zmanim/location_test.go +++ b/zmanim/location_test.go @@ -3,7 +3,7 @@ package zmanim_test import ( "testing" - "github.com/hebcal/hebcal-go/zmanim" + "github.com/MaxBGreenberg/hebcal-go/zmanim" ) func TestNoDuplicateCities(t *testing.T) { diff --git a/zmanim/zmanim.go b/zmanim/zmanim.go index 1cebd1d..e61fd60 100644 --- a/zmanim/zmanim.go +++ b/zmanim/zmanim.go @@ -183,6 +183,14 @@ func (z *Zmanim) SofZmanTfilla() time.Time { return z.hourOffset(4) } + +// On erev pesach, sof zman achilas chametz is at the same time as sof zman fefillah +// Sof zman biur chametz, the latested time it is permitted to have hanaa from chametz, is 1 halchik hour later +// According to the GRA +func (z *Zmanim) SofZmanBiur() time.Time { + return z.hoursOffset(5) +} + func (z *Zmanim) sofZmanMGA(hours float64) time.Time { alot72 := z.SunriseOffset(-72, false) tzeit72 := z.SunsetOffset(72, false) @@ -202,6 +210,11 @@ func (z *Zmanim) SofZmanTfillaMGA() time.Time { return z.sofZmanMGA(4) } +// Sof zman biur chametz accoring to MGA +func (z *Zmanim) SofZmanBiurMGA() time.Time { + return z.sofZmanMGA(5) +} + // Earliest Mincha – Mincha Gedola; Sunrise plus 6.5 halachic hours func (z *Zmanim) MinchaGedola() time.Time { return z.hourOffset(6.5) @@ -224,11 +237,18 @@ func (z *Zmanim) PlagHaMincha() time.Time { // For 3 medium stars use 7.083° func (z *Zmanim) Tzeit(angle float64) time.Time { if angle == 0 { - angle = Tzeit3SmallStars + angle = Tzeit3MediumStars } return z.timeAtAngle(angle, false) } +// Rabbeinu Tam holds that bein hashmashos is a specific time between sunset and tzeis hakochavim +// One opinion on how to calculate this time is that it is 13.5 minutes before tzies 7.083 +func (z *Zmanim) BeinHashmashos() time.Time { + tzeis=z.Tzeit(Tzeit3MediumStars) + return tzeis.Add(-13.5 *time.Minute) +} + func (z *Zmanim) riseSetOffset(t time.Time, offset int, roundTime bool) time.Time { if t == nilTime { return t diff --git a/zmanim/zmanim_test.go b/zmanim/zmanim_test.go index ea2bfce..deca3f1 100644 --- a/zmanim/zmanim_test.go +++ b/zmanim/zmanim_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/hebcal/hebcal-go/zmanim" + "github.com/MaxBGreenberg/hebcal-go/zmanim" "github.com/stretchr/testify/assert" )