mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 07:29:22 +00:00
Changed localize_date to formatdate
This commit is contained in:
@@ -4,8 +4,8 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _, _dict
|
from frappe import _, _dict
|
||||||
from frappe.utils import (cstr, flt, cint,
|
from frappe.utils import (flt, cint, getdate, get_first_day, get_last_day,
|
||||||
getdate, get_first_day, get_last_day, add_months, add_days, now_datetime, localize_date)
|
add_months, add_days, now_datetime, formatdate)
|
||||||
|
|
||||||
def process_filters(filters):
|
def process_filters(filters):
|
||||||
filters.depth = cint(filters.depth) or 3
|
filters.depth = cint(filters.depth) or 3
|
||||||
@@ -48,14 +48,14 @@ def get_period_list(fiscal_year, periodicity, from_beginning=False):
|
|||||||
if to_date > today:
|
if to_date > today:
|
||||||
# checking in the middle of the currenct fiscal year? don't show future periods
|
# checking in the middle of the currenct fiscal year? don't show future periods
|
||||||
key = today.strftime("%b_%Y").lower()
|
key = today.strftime("%b_%Y").lower()
|
||||||
label = localize_date(today, "MMM YYYY")
|
label = formatdate(today, "MMM YYYY")
|
||||||
period_list.append(_dict({"to_date": today, "key": key, "label": label}))
|
period_list.append(_dict({"to_date": today, "key": key, "label": label}))
|
||||||
break
|
break
|
||||||
|
|
||||||
elif to_date <= end_date:
|
elif to_date <= end_date:
|
||||||
# the normal case
|
# the normal case
|
||||||
key = to_date.strftime("%b_%Y").lower()
|
key = to_date.strftime("%b_%Y").lower()
|
||||||
label = localize_date(to_date, "MMM YYYY")
|
label = formatdate(to_date, "MMM YYYY")
|
||||||
period_list.append(_dict({"to_date": to_date, "key": key, "label": label}))
|
period_list.append(_dict({"to_date": to_date, "key": key, "label": label}))
|
||||||
|
|
||||||
# if it ends before a full year
|
# if it ends before a full year
|
||||||
@@ -65,7 +65,7 @@ def get_period_list(fiscal_year, periodicity, from_beginning=False):
|
|||||||
else:
|
else:
|
||||||
# if a fiscal year ends before a 12 month period
|
# if a fiscal year ends before a 12 month period
|
||||||
key = end_date.strftime("%b_%Y").lower()
|
key = end_date.strftime("%b_%Y").lower()
|
||||||
label = localize_date(end_date, "MMM YYYY")
|
label = formatdate(end_date, "MMM YYYY")
|
||||||
period_list.append(_dict({"to_date": end_date, "key": key, "label": label}))
|
period_list.append(_dict({"to_date": end_date, "key": key, "label": label}))
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user