def _get_ishaa_time(self): if (type(self._conf.ishaa_angle) is FixedTime): is_ramadan = HijriDate.get_hijri(self._date, self._correction_val).month == 9 time_after_maghreb = self._conf.ishaa_angle.ramadan_time_hr if is_ramadan else self._conf.ishaa_angle.all_year_time_hr ishaa_t = (time_after_maghreb + self._dohr_time + self._get_time_for_angle(self._conf.maghreb_angle)) else: ishaa_t = self._dohr_time + \ self._get_time_for_angle(self._conf.ishaa_angle) return ishaa_t
def ishaaTime(self, shift=0.0): '''Get the Ishaa time''' if (self.__conf.ishaaZenith is None): # ishaaZenith==None <=> method == Umm al-Qura University, Makkah if HijriDate.getHijri(self.__date, self.__correction_val).month == 9: ishaa_t = self.__dohrTime() +self.__prayerTime(self.__conf.maghrebZenith) + 2.0 else: ishaa_t = self.__dohrTime() +self.__prayerTime(self.__conf.maghrebZenith) + 1.5 else: ishaa_t = self.__prayerTime(self.__conf.ishaaZenith) ishaa_t = self.__dohrTime() + ishaa_t return Prayer._Prayer__hoursToTime(ishaa_t, shift, self.__conf.summerTime)
def ishaa_time(self, shift=0.0): '''Get the Ishaa time''' if (self._conf.ishaa_zenith is None): # ishaa_zenith==None <=> method == Umm al-Qura University, Makkah if HijriDate.get_hijri(self._date, self._correction_val).month == 9: ishaa_t = self._dohr_time() + self._time(self._conf.maghreb_zenith) + 2.0 else: ishaa_t = self._dohr_time() + self._time(self._conf.maghreb_zenith) + 1.5 else: ishaa_t = self._time(self._conf.ishaa_zenith) ishaa_t = self._dohr_time() + ishaa_t return Prayer._hours_to_time(ishaa_t, shift, self._conf.summer_time)
def test_hijri(): hijri_date = HijriDate(1442, 8, 25) tomorrow = hijri_date.next_date() gregorian = hijri_date.to_gregorian() hijri_from_gregorian = hijri_date.get_hijri(date(2021, 4, 9)) hijri_from_julian = hijri_date.from_julian(2459313) assert hijri_date.format() == "25-08-1442" # FIXME according to https://www.islamicfinder.org/islamic-calendar/ # it should be 27 Shaban 1442 assert hijri_date.format(2) == "25 Shaban 1442" assert tomorrow.format() == "26-08-1442" assert tomorrow.format(2) == "26 Shaban 1442" assert gregorian == date(2021, 4, 13) assert hijri_from_gregorian.format(2) == "25 Shaban 1442" assert hijri_from_julian.format(2) == "25 Shaban 1442"
fieldNames = ["Enter your choice (from 1 to 5)"] fieldValues = [] fieldValues = multenterbox(msg, title, fieldNames) fajr_isha_method = int(fieldValues[0]) msg = "Choose the Asr Madhab\n\n1 = Shafii\n2 = Hanafi" title = "Islamic Prayer" fieldNames = ["Enter your choice (from 1 or 2)"] fieldValues = [] fieldValues = multenterbox(msg, title, fieldNames) asr_fiqh = int(fieldValues[0]) pconf = PrayerConf(longitude, latitude, timezone, fajr_isha_method, asr_fiqh) pt = Prayer(pconf, date.today()) hijri = HijriDate.today() 0 image = isworld msg = "Prayer Times\n\nFajr: " + str( pt.fajr_time()) + str("\nSherook: " + str(pt.sherook_time())) + str( "\nDohr: " + str(pt.dohr_time()) ) + str("\nAsr: " + str(pt.asr_time())) + str("\nMaghreb: " + str( pt.maghreb_time())) + str("\nIshaa: " + str(pt.ishaa_time())) + str( "\n\nQiblah direction from the north: " + Qiblah(pconf).sixty()) choices = ["Ok"] reply = buttonbox(msg, image=image, choices=choices)
print('''\n4. Choose the Fajr and Ishaa reference: -------------------------------------''') for j in range(0, 5): print('%d = %s' % (j+1, fi[j])) fajr_isha_method = int(input('Enter your choice (from 1 to 5): ')) print('\n5. Choose the Asr Madhab:\n-------------------------------------') print('1 = Shafii\n2 = Hanafi') asr_fiqh = int(input('Enter your choice (1 or 2): ')) pconf = PrayerConf(longitude, latitude, timezone, fajr_isha_method, asr_fiqh) pt = Prayer(pconf, date.today()) hijri = HijriDate.today(1) print('Longitude:\n\t', longitude) print('Latitude:\n\t', latitude) def tz(t): if t < 0: return 'GMT' + str(t) else: return 'GMT+' + str(t) print('Timezone:\n\t', tz(timezone)) print('Fajr and Ishaa reference:\n\t', fi[fajr_isha_method - 1]) print('Asr madhab:\n\t', ar[asr_fiqh - 1]) print('\nPrayer times for: ' + hijri.format(2) + ' ' + str(hijri.toGregorian()))
#!/usr/bin/python3 import sys sys.path.append('../') from pyIslam.hijri import HijriDate year = 1 hi = HijriDate(year, 1, 1) days = [[]] while hi.year < 1435: next_hi = hi.nextDate() if next_hi.year != hi.year: days.append([]) if next_hi.isLast(): days[next_hi.year - year].append \ ('%04d-%02d = %d' % (next_hi.year, next_hi.month, next_hi.day)) del hi hi = next_hi for day in days: print(day)
#!/usr/bin/python3 import sys sys.path.append('../') from pyIslam.hijri import HijriDate year = 1 hi = HijriDate(year, 1, 1) days = [[]] while hi.year < 1435: next_hi = hi.nextDate() if next_hi.year != hi.year: days.append([]) if next_hi.isLast(): days[next_hi.year - year].append \ ('%04d-%02d = %d' % (next_hi.year, next_hi.month, next_hi.day)) del hi hi = next_hi for day in days: print(day)