Replaced the PeriodSpecification object-based utility with the get_spec function-based utility, for simplicity.

This commit is contained in:
2023-03-09 19:30:36 +08:00
parent 7ad3f9e0cb
commit 4432484acd
2 changed files with 86 additions and 84 deletions

View File

@ -27,7 +27,7 @@ from datetime import date, timedelta
from accounting.locale import gettext
from .description import get_desc
from .parser import parse_spec
from .specification import PeriodSpecification
from .specification import get_spec
class Period:
@ -90,7 +90,7 @@ class Period:
:return: None.
"""
self.spec = PeriodSpecification(self.start, self.end).spec
self.spec = get_spec(self.start, self.end)
self.desc = get_desc(self.start, self.end)
if self.start is None or self.end is None:
return