Skip to content

Commit

Permalink
fixed issue with taanis esther
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Smith committed Feb 21, 2024
1 parent ecb48f4 commit 4e4e7e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Binary file not shown.
2 changes: 1 addition & 1 deletion Sources/KosherSwift/HebrewCalendar/JewishCalendar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public class JewishCalendar: JewishDate {
public var isChanukah: Bool { (month == .kislev && day >= 25) || (month == .teves && ((day == 1 || day == 2) || (day == 3 && isKislevShort)))}
public var isTenthOfTeves: Bool { month == .teves && day == 10 }
public var isTuBeshvat: Bool { month == .shevat && day == 15 }
public var isFastOfEsther: Bool { (month == .adar && (((day == 11 || day == 12) && dow == .thursday) || (day == 13 && !(dow == .friday || dow == .saturday)))) || (isJewishLeapYear && month == .adar2 && (((day == 11 || day == 12) && dow == .thursday) || (day == 13 && !(dow == .friday || dow == .saturday)))) }
public var isFastOfEsther: Bool { (!isJewishLeapYear && month == .adar && (((day == 11 || day == 12) && dow == .thursday) || (day == 13 && !(dow == .friday || dow == .saturday)))) || (isJewishLeapYear && month == .adar2 && (((day == 11 || day == 12) && dow == .thursday) || (day == 13 && !(dow == .friday || dow == .saturday)))) }
public var isPurim: Bool { (!isJewishLeapYear && month == .adar && day == 14) || (isJewishLeapYear && month == .adar2 && day == 14) }
public var isShushanPurim: Bool { (!isJewishLeapYear && month == .adar && day == 15) || (isJewishLeapYear && month == .adar2 && day == 15) }
public var isPurimKatan: Bool { isJewishLeapYear && month == .adar && day == 14 }
Expand Down
9 changes: 9 additions & 0 deletions Tests/KosherSwiftTests/KosherSwiftTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,15 @@ final class KosherSwiftTests: XCTestCase {
checkTimeEquals(cal.minchaKetanaGRAFixedLocalChatzosToSunset(), 17, 57)
}

func testTaanisEsther() {
let cal = JewishCalendar(date: Date(year: 2024, month: 2, day: 22), isInIsrael: false)
XCTAssertFalse(cal.isFastOfEsther)

let cal2 = JewishCalendar(date: Date(year: 2024, month: 3, day: 21), isInIsrael: false)
XCTAssertTrue(cal2.isFastOfEsther)
}


func testNextWeekday() {
let startYear = 2023
let startMonth = 12
Expand Down

0 comments on commit 4e4e7e0

Please sign in to comment.