Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,7 +47,10 @@ class PrayTimes():
|
|
| 47 |
'params': { 'fajr': 17.7, 'isha': 14, 'maghrib': 4.5, 'midnight': 'Jafari' } }, # isha is not explicitly specified in this method
|
| 48 |
'Jafari': {
|
| 49 |
'name': 'Shia Ithna-Ashari, Leva Institute, Qum',
|
| 50 |
-
'params': { 'fajr': 16, 'isha': 14, 'maghrib': 4, 'midnight': 'Jafari' } }
|
|
|
|
|
|
|
|
|
|
| 51 |
}
|
| 52 |
|
| 53 |
# Default Parameters in Calculation Methods
|
|
@@ -420,6 +423,7 @@ def calculate_monthly_prayer_times(year, month, latitude, longitude, timezone, d
|
|
| 420 |
def calculate_monthly_prayer_times(year, month, latitude, longitude, timezone, dst, calc_method):
|
| 421 |
PT = PrayTimes(calc_method)
|
| 422 |
PT.setMethod(calc_method)
|
|
|
|
| 423 |
num_days = calendar.monthrange(year, month)[1]
|
| 424 |
prayer_times = []
|
| 425 |
for day in range(1, num_days + 1):
|
|
@@ -451,10 +455,11 @@ st.title('Yearly Muslim Prayer Times Calendar')
|
|
| 451 |
|
| 452 |
default_latitude = 11.495351
|
| 453 |
default_longitude = 79.759439
|
|
|
|
| 454 |
latitude = st.number_input('Enter your latitude:', value=default_latitude, format='%f')
|
| 455 |
longitude = st.number_input('Enter your longitude:', value=default_longitude, format='%f')
|
| 456 |
-
calc_method = st.selectbox('Select Calculation Method:', options=['MWL', 'ISNA', 'Egypt', 'Makkah', 'Karachi', 'Tehran', 'Jafari'])
|
| 457 |
-
timezone = st.number_input('Enter your timezone offset from UTC:', format='%f')
|
| 458 |
dst = st.checkbox('Daylight Saving Time')
|
| 459 |
|
| 460 |
current_year = date.today().year
|
|
@@ -477,4 +482,4 @@ if st.button('Calculate Prayer Times'):
|
|
| 477 |
data=csv,
|
| 478 |
file_name=f"prayer_times_{selected_month}_{current_year}.csv",
|
| 479 |
mime='text/csv',
|
| 480 |
-
)
|
|
|
|
| 47 |
'params': { 'fajr': 17.7, 'isha': 14, 'maghrib': 4.5, 'midnight': 'Jafari' } }, # isha is not explicitly specified in this method
|
| 48 |
'Jafari': {
|
| 49 |
'name': 'Shia Ithna-Ashari, Leva Institute, Qum',
|
| 50 |
+
'params': { 'fajr': 16, 'isha': 14, 'maghrib': 4, 'midnight': 'Jafari' } },
|
| 51 |
+
'TN': {
|
| 52 |
+
'name': 'Tamil Nadu',
|
| 53 |
+
'params': { 'fajr': 18, 'isha': 18} }
|
| 54 |
}
|
| 55 |
|
| 56 |
# Default Parameters in Calculation Methods
|
|
|
|
| 423 |
def calculate_monthly_prayer_times(year, month, latitude, longitude, timezone, dst, calc_method):
|
| 424 |
PT = PrayTimes(calc_method)
|
| 425 |
PT.setMethod(calc_method)
|
| 426 |
+
PT.timeFormat = '12h'
|
| 427 |
num_days = calendar.monthrange(year, month)[1]
|
| 428 |
prayer_times = []
|
| 429 |
for day in range(1, num_days + 1):
|
|
|
|
| 455 |
|
| 456 |
default_latitude = 11.495351
|
| 457 |
default_longitude = 79.759439
|
| 458 |
+
default_timezone = 5.5
|
| 459 |
latitude = st.number_input('Enter your latitude:', value=default_latitude, format='%f')
|
| 460 |
longitude = st.number_input('Enter your longitude:', value=default_longitude, format='%f')
|
| 461 |
+
calc_method = st.selectbox('Select Calculation Method:', options=['MWL', 'ISNA', 'Egypt', 'Makkah', 'Karachi', 'Tehran', 'Jafari', 'TN'])
|
| 462 |
+
timezone = st.number_input('Enter your timezone offset from UTC:', value=default_timezone, format='%f')
|
| 463 |
dst = st.checkbox('Daylight Saving Time')
|
| 464 |
|
| 465 |
current_year = date.today().year
|
|
|
|
| 482 |
data=csv,
|
| 483 |
file_name=f"prayer_times_{selected_month}_{current_year}.csv",
|
| 484 |
mime='text/csv',
|
| 485 |
+
)
|