Added the default_spec() method to Period, and applied it to the views in the accounting application.

This commit is contained in:
2020-07-29 19:08:10 +08:00
parent 79337272ec
commit e64089f06f
2 changed files with 15 additions and 13 deletions

View File

@ -314,6 +314,15 @@ class Period:
"defaultDate": self.chosen_month,
})
@staticmethod
def default_spec():
"""Returns the specification for the default period.
Returns:
str: The specification for the default period
"""
return dateformat.format(timezone.localdate(), "Y-m")
class Parser:
"""The period parser.