Replaced the PeriodDescription object-based utility with the get_desc function-based utility, for simplicity.

This commit is contained in:
2023-03-09 19:22:06 +08:00
parent 060a52f7a2
commit 7ad3f9e0cb
2 changed files with 129 additions and 127 deletions
src/accounting/report/period

@ -25,7 +25,7 @@ import typing as t
from datetime import date, timedelta
from accounting.locale import gettext
from .description import PeriodDescription
from .description import get_desc
from .parser import parse_spec
from .specification import PeriodSpecification
@ -91,7 +91,7 @@ class Period:
:return: None.
"""
self.spec = PeriodSpecification(self.start, self.end).spec
self.desc = PeriodDescription(self.start, self.end).desc
self.desc = get_desc(self.start, self.end)
if self.start is None or self.end is None:
return
self.is_a_month = self.start.day == 1 \