summaryrefslogtreecommitdiff
path: root/payments/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'payments/utils.py')
-rw-r--r--payments/utils.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/payments/utils.py b/payments/utils.py
new file mode 100644
index 0000000..2d78659
--- /dev/null
+++ b/payments/utils.py
@@ -0,0 +1,14 @@
+from datetime import date
+
+from django.utils.translation import ugettext_lazy as _
+
+
+def get_month_choices():
+ month_choices = [(str(x), '%02d' % (x,)) for x in range(1, 13)]
+ return [('', _('Month'))] + month_choices
+
+
+def get_year_choices():
+ year_choices = [(str(x), str(x)) for x in range(
+ date.today().year, date.today().year + 15)]
+ return [('', _('Year'))] + year_choices