fix --night-threshold

This commit is contained in:
boyska 2023-08-30 16:14:49 +02:00
parent 96891a1921
commit 28bcbd9f1e

View file

@ -1,5 +1,6 @@
#!/usr/bin/python3
import sys
import logging
import argparse
import os.path
@ -132,6 +133,9 @@ class PelicanConverter(Converter):
fpath = talkdir / fname
self.changed_files.append(fpath)
day = (talk.decoded('DTSTART').date() - self.talks_metadata['startdate']).days
after_midnight = talk.decoded('DTSTART').hour < self.args.night_threshold
if after_midnight:
day -= 1
frontmatter = dict(
key=uid,
title=talk.decoded("SUMMARY").decode("utf8"),