[utils] add a format_date_year function
This commit is contained in:
parent
d29d569578
commit
b1c55eb1b1
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue