From ef086b3f81a90a868daa3f214b199496bbfd225d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Thu, 9 Mar 2023 18:03:02 +0800 Subject: [PATCH] Revised to simplify the YearPeriod period. --- src/accounting/report/period.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/accounting/report/period.py b/src/accounting/report/period.py index 2f9b1a2..2891549 100644 --- a/src/accounting/report/period.py +++ b/src/accounting/report/period.py @@ -553,6 +553,7 @@ class TemplatePeriod(Period): class YearPeriod(Period): """A year period.""" + def __init__(self, year: int): """Constructs a year period. @@ -561,8 +562,6 @@ class YearPeriod(Period): start: datetime.date = datetime.date(year, 1, 1) end: datetime.date = datetime.date(year, 12, 31) super().__init__(start, end) - self.spec = str(year) - self.is_a_year = True DATE_SPEC_RE: str = r"(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?"