# HG changeset patch # User jgindin@chagall # Date 1627960853 14400 # Mon Aug 02 23:20:53 2021 -0400 # Node ID 0797baeabdc851910eaaf09954942a14f4831e43 # Parent feb2a169e8a012d886065db3f68e4c11fe696781 Change to use KosherJava's getSolarMidnight(). diff --git a/ZmanLib/src/main/java/com/gindin/zmanlib/zman/NightChatzot.java b/ZmanLib/src/main/java/com/gindin/zmanlib/zman/NightChatzot.java --- a/ZmanLib/src/main/java/com/gindin/zmanlib/zman/NightChatzot.java +++ b/ZmanLib/src/main/java/com/gindin/zmanlib/zman/NightChatzot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014. Jay R. Gindin + * Copyright (c) 2021. Jay R. Gindin */ package com.gindin.zmanlib.zman; @@ -27,7 +27,7 @@ zmanim.add( new Zman( "Mid-night", "GR'A, based on the day for Jewish halachic times starts at sunrise and ends at sunset.", Zmanim.Type.NightChatzot, false ) { @Override protected Calendar calculate() { - return toCalendar( zmanimCalculator, zmanimCalculator.getNightChatzos() ); + return toCalendar( zmanimCalculator, zmanimCalculator.getSolarMidnight() ); } } ); diff --git a/ZmanLib/src/main/java/com/gindin/zmanlib/zman/ZmanimCalculator.java b/ZmanLib/src/main/java/com/gindin/zmanlib/zman/ZmanimCalculator.java --- a/ZmanLib/src/main/java/com/gindin/zmanlib/zman/ZmanimCalculator.java +++ b/ZmanLib/src/main/java/com/gindin/zmanlib/zman/ZmanimCalculator.java @@ -190,25 +190,6 @@ return getTimeOffset(getSeaLevelSunset(), -minutesBeforeShkia * MINUTE_MILLIS); } - /** - * Method to calculate the middle of the night as defined by the midpoint between sunset and sunrise. - * - * @return the Date representing the middle of the night. Will return null if either the - * sunset or sunrise cannot be calculated. - */ - public Date getNightChatzos() { - - ZmanimCalculator clonedCal = (ZmanimCalculator)clone(); - clonedCal.getCalendar().add( Calendar.DAY_OF_MONTH, 1); - Date sunset = getSeaLevelSunset(); - Date sunrise = clonedCal.getSeaLevelSunrise(); - if ( ( null == sunset ) || ( null == sunrise ) ) { - return null; - } - - return getTimeOffset( sunset, ( sunrise.getTime() - sunset.getTime() ) / 2 ); - } - /** * Calculates the middle of the night as a 12 hours after the fixed local chatzot.