diff --git a/fixedcal/__init__.py b/fixedcal/__init__.py index e69de29..4e7a8c5 100644 --- a/fixedcal/__init__.py +++ b/fixedcal/__init__.py @@ -0,0 +1 @@ +from fixedcal.core.date import FixedDate \ No newline at end of file diff --git a/fixedcal/core/date.py b/fixedcal/core/date.py index 4269261..2bc407b 100644 --- a/fixedcal/core/date.py +++ b/fixedcal/core/date.py @@ -150,3 +150,12 @@ class FixedDate: new_date = self.datetime - o return FixedDate(date=new_date) raise ValueError("Invalid subtractor type, expected FixedDate or timedelta") + + def __str__(self) -> str: + """String representation of fixed date. + For year day, month is 14 and date 1. + + Returns: + str: Date as YYYY-MM-DD + """ + return f"{self._year:04.0f}-{self.month:02.0f}-{self.day_of_month:02.0f}"