Use as_date() from utils
This commit is contained in:
parent
cf298f261f
commit
6e9604e4c1
|
@ -242,11 +242,6 @@ def travel_list() -> str:
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def as_date(d: date | datetime) -> date:
|
|
||||||
"""Date of event."""
|
|
||||||
return d.date() if isinstance(d, datetime) else d
|
|
||||||
|
|
||||||
|
|
||||||
def build_conference_list() -> list[StrDict]:
|
def build_conference_list() -> list[StrDict]:
|
||||||
"""Build conference list."""
|
"""Build conference list."""
|
||||||
data_dir = app.config["PERSONAL_DATA"]
|
data_dir = app.config["PERSONAL_DATA"]
|
||||||
|
@ -260,8 +255,8 @@ def build_conference_list() -> list[StrDict]:
|
||||||
conference_trip_lookup[key] = trip
|
conference_trip_lookup[key] = trip
|
||||||
|
|
||||||
for conf in items:
|
for conf in items:
|
||||||
conf["start_date"] = as_date(conf["start"])
|
conf["start_date"] = agenda.utils.as_date(conf["start"])
|
||||||
conf["end_date"] = as_date(conf["end"])
|
conf["end_date"] = agenda.utils.as_date(conf["end"])
|
||||||
|
|
||||||
price = conf.get("price")
|
price = conf.get("price")
|
||||||
if price:
|
if price:
|
||||||
|
|
Loading…
Reference in a new issue