From b139817bfa7bb47219765295ca6d57695e107700 Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Thu, 16 Nov 2023 21:17:47 +0100 Subject: [PATCH] fix YYYY date issue (#5) --- rendercv/data_model.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rendercv/data_model.py b/rendercv/data_model.py index 6891a4c..f06309f 100644 --- a/rendercv/data_model.py +++ b/rendercv/data_model.py @@ -115,6 +115,7 @@ def parse_date_string(date_string: str) -> Date | int: raise ValueError( f'The date string "{date_string}" is not in YYYY-MM-DD, YYYY-MM, or YYYY' " format." + " format." ) if isinstance(date, Date): @@ -628,8 +629,11 @@ class Design(BaseModel): # ====================================================================================== LaTeXString = Annotated[str, AfterValidator(escape_latex_characters)] +SpellCheckedString = Annotated[LaTeXString, AfterValidator(check_spelling)] PastDate = Annotated[ - str, Field(pattern=r"\d{4}-?(\d{2})?-?(\d{2})?"), AfterValidator(parse_date_string) + str, + Field(pattern=r"\d{4}-?(\d{2})?-?(\d{2})?"), + AfterValidator(parse_date_string), ]