mirror of
https://github.com/Kunsi/scheduled-plugin-pretalx-broadcast-tools.git
synced 2024-11-22 01:51:03 +00:00
i hate pytz, i hate python2, i hate everything
This commit is contained in:
parent
025e1bf2c7
commit
de1f01b004
1 changed files with 3 additions and 2 deletions
5
service
5
service
|
@ -125,6 +125,7 @@ def main():
|
||||||
raw_schedule["conference"]["start"][:10], "%Y-%m-%d"
|
raw_schedule["conference"]["start"][:10], "%Y-%m-%d"
|
||||||
)
|
)
|
||||||
event_tz = pytz.timezone(raw_schedule["conference"]["time_zone_name"])
|
event_tz = pytz.timezone(raw_schedule["conference"]["time_zone_name"])
|
||||||
|
utc_offset = datetime.now(event_tz).utcoffset().total_seconds()
|
||||||
|
|
||||||
for day in raw_schedule["conference"]["days"]:
|
for day in raw_schedule["conference"]["days"]:
|
||||||
for room in day["rooms"].values():
|
for room in day["rooms"].values():
|
||||||
|
@ -135,9 +136,9 @@ def main():
|
||||||
d_h, d_m = talk["duration"].split(":")
|
d_h, d_m = talk["duration"].split(":")
|
||||||
end = start + timedelta(hours=int(d_h), minutes=int(d_m))
|
end = start + timedelta(hours=int(d_h), minutes=int(d_m))
|
||||||
|
|
||||||
talk["start_ts"] = timegm(start.timetuple())
|
talk["start_ts"] = int(timegm(start.timetuple()) - utc_offset)
|
||||||
talk["start_str"] = talk["start"]
|
talk["start_str"] = talk["start"]
|
||||||
talk["end_ts"] = timegm(end.timetuple())
|
talk["end_ts"] = int(timegm(end.timetuple()) - utc_offset)
|
||||||
talk["locale"] = talk["language"]
|
talk["locale"] = talk["language"]
|
||||||
|
|
||||||
track = None
|
track = None
|
||||||
|
|
Loading…
Reference in a new issue