my.calendar.holidays: unhardcode calendar, detect it from the location data

This commit is contained in:
Dima Gerasimov 2020-10-09 20:44:47 +01:00 committed by karlicoss
parent bdb5dcd221
commit 96113ad5ae
5 changed files with 49 additions and 7 deletions

View file

@ -119,6 +119,7 @@ def _get_home_tz(loc) -> Optional[pytz.BaseTzInfo]:
return pytz.timezone(zone)
# TODO expose? to main as well?
def _get_tz(dt: datetime) -> Optional[pytz.BaseTzInfo]:
res = _get_day_tz(d=dt.date())
if res is not None: