diff --git a/jsonresume_reader.py b/jsonresume_reader.py index c520cb8..f4b51e5 100644 --- a/jsonresume_reader.py +++ b/jsonresume_reader.py @@ -46,12 +46,18 @@ class JSONResumeReader(readers.RstReader): def format_date_short(d): return date.fromisoformat(d).strftime('%B %Y').capitalize() + @setlocale + def format_date_year(d): + return date.fromisoformat(d).strftime('%Y').capitalize() + + format_date_full = lambda d: date.fromisoformat(d).strftime('%d %B %Y').capitalize() isinfinite = lambda d: date.fromisoformat(d).isoformat() == '2999-01-01' metadata['utils'] = { 'get_country_name': countryname, 'format_date_short': format_date_short, 'format_date_full': format_date_full, + 'format_date_year': format_date_year, 'isinfinite': isinfinite } return content, metadata