fix(formatdate): always replace mm by MM for babel.dates

This commit is contained in:
Rushabh Mehta 2018-10-15 10:34:17 +05:30
parent c0ba708ee5
commit 1f1a1ec810

View file

@ -223,7 +223,8 @@ def formatdate(string_date=None, format_string=None):
date = getdate(string_date)
if not format_string:
format_string = get_user_format().replace("mm", "MM")
format_string = get_user_format()
format_string = format_string.replace("mm", "MM")
try:
formatted_date = babel.dates.format_date(date, format_string, locale=(frappe.local.lang or "").replace("-", "_"))
except UnknownLocaleError: