fix --night-threshold
This commit is contained in:
parent
96891a1921
commit
28bcbd9f1e
1 changed files with 4 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import sys
|
||||||
import logging
|
import logging
|
||||||
import argparse
|
import argparse
|
||||||
import os.path
|
import os.path
|
||||||
|
@ -132,6 +133,9 @@ class PelicanConverter(Converter):
|
||||||
fpath = talkdir / fname
|
fpath = talkdir / fname
|
||||||
self.changed_files.append(fpath)
|
self.changed_files.append(fpath)
|
||||||
day = (talk.decoded('DTSTART').date() - self.talks_metadata['startdate']).days
|
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(
|
frontmatter = dict(
|
||||||
key=uid,
|
key=uid,
|
||||||
title=talk.decoded("SUMMARY").decode("utf8"),
|
title=talk.decoded("SUMMARY").decode("utf8"),
|
||||||
|
|
Loading…
Reference in a new issue