Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Elyahu41 authored Jan 3, 2024
1 parent 390bbba commit a8c4886
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ Then, it as simple as instantiating a class and calling it's methods:
```Swift
let jewishCalendar = JewishCalendar() // by default it is set to today's date
print(jewishCalendar.getJewishMonth()) // This will print the jewish month as a number, so Nissan will be 8. See the JewishCalendar class for more details

// To check for holidays/yom tovs, you can use the built in methods of the jewish calendar:
if jewishCalendar.isPesach() {
print("Today is Passover!")
}
// or you can check it yourself with the getYomTovIndex() method just like in KosherJava:
if jewishCalendar.getYomTovIndex() == JewishCalendar.PESACH {
print("Today is Passover!")
}
```
For sunrise and sunset times, you will need a GeoLocation object. Then, you will need to pass that into the AstronomicalCalendar class like so:
```Swift
Expand Down Expand Up @@ -115,7 +124,7 @@ public extension ComplexZmanimCalendar {
// for seasonal times
func getTwoSeasonalHoursIntoTheDay() -> Date? {
let seasonalHour = getTemporalHour()
// it is preffered to use getTimeOffset because it will handle nil values
// it is preferred to use getTimeOffset because it will handle nil values
return AstronomicalCalendar.getTimeOffset(time: getSeaLevelSunrise(), offset: seasonalHour * 2)
}
}
Expand Down

0 comments on commit a8c4886

Please sign in to comment.