Add formatting for dates with precision 10 and 11
This commit is contained in:
parent
cc97f41f2b
commit
fe664be570
|
@ -123,6 +123,10 @@ def format_time(time_value: str, precision: int) -> str:
|
||||||
return time_value
|
return time_value
|
||||||
year = t.year
|
year = t.year
|
||||||
|
|
||||||
|
if precision == 11:
|
||||||
|
return t.strftime("%-d %B %Y")
|
||||||
|
if precision == 10:
|
||||||
|
return datetime.strptime(time_value[1:9] + "01", "%Y-%m-%d").strftime("%B %Y")
|
||||||
if precision == 9:
|
if precision == 9:
|
||||||
return str(year)
|
return str(year)
|
||||||
if precision == 8:
|
if precision == 8:
|
||||||
|
|
Loading…
Reference in a new issue