From 9ff084ff106b955d5dcc9ceb3b31ba4c1f0d46c5 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Fri, 11 Nov 2022 15:29:25 +0100 Subject: [PATCH] bib2html: Sanitize bibentry sort without month --- bib2html.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bib2html.py b/bib2html.py index 64286f2..72a5771 100755 --- a/bib2html.py +++ b/bib2html.py @@ -136,11 +136,16 @@ def entryDateSortKey(p): 'apr' : '04', 'may' : '05', 'jun' : '06', \ 'jul' : '07', 'aug' : '08', 'sep' : '09', \ 'oct' : '10', 'nov' : '11', 'dec' : '12'} + + if not 'month' in e.fields: + return e.fields['year'] + month = e.fields['month'].lower()[0:3] if month in month2num: month = month2num[month] else: month = "" + return e.fields['year'] + "-" + month -- 2.39.5