diff --git a/accounting/views.py b/accounting/views.py index 6daf014..9dd17bc 100644 --- a/accounting/views.py +++ b/accounting/views.py @@ -29,7 +29,7 @@ from django.views import generic from django.views.decorators.http import require_GET from accounting.models import Record -from accounting.utils import PeriodParser +from mia_core.period import PeriodParser from mia import settings from mia_core.digest_auth import digest_login_required from mia_core.utils import UrlBuilder, Pagination, \ diff --git a/accounting/utils.py b/mia_core/period.py similarity index 97% rename from accounting/utils.py rename to mia_core/period.py index ef7d837..e336943 100644 --- a/accounting/utils.py +++ b/mia_core/period.py @@ -15,16 +15,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""The utilities of the accounting application. +"""The utilities of the period chooser of the Mia core application. """ + import re -from datetime import date +from datetime import date, timedelta from django.template import defaultfilters from django.utils import dateformat -from django.utils.timezone import localdate, timedelta -from django.utils.translation import pgettext, gettext +from django.utils.timezone import localdate +from django.utils.translation import gettext, pgettext class PeriodParser: @@ -222,4 +223,4 @@ class PeriodParser: prev = date(prev_year, prev_month, 1) if year == prev.year and month == prev.month: return gettext("Last Month") - return "%d/%d" % (year, month) + return "%d/%d" % (year, month) \ No newline at end of file