File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -272,12 +272,15 @@ def clean_bibtex_tags(s, normalize=False):
272272
273273
274274def month2number (month ):
275- """Convert BibTeX month to numeric"""
276- month_abbr = month .strip ()[:3 ].title ()
277- try :
278- return str (list (calendar .month_abbr ).index (month_abbr )).zfill (2 )
279- except ValueError :
280- raise ValueError ('Please update your BibTeX with valid months' )
275+ """Convert BibTeX or BibLateX month to numeric"""
276+ if len (month ) <= 2 : # Assume a 1 or 2 digit numeric month has been given.
277+ return month .zfill (2 )
278+ else : # Assume a textual month has been given.
279+ month_abbr = month .strip ()[:3 ].title ()
280+ try :
281+ return str (list (calendar .month_abbr ).index (month_abbr )).zfill (2 )
282+ except ValueError :
283+ raise log .error ('Please update the entry with a valid month.' )
281284
282285
283286def import_assets ():
You can’t perform that action at this time.
0 commit comments