Add date format configurability to date format function (#5037)
This commit is contained in:
parent
aa5f9516da
commit
08a6727fb8
1 changed files with 2 additions and 2 deletions
|
|
@ -254,10 +254,10 @@ def format_datetime(datetime_string, format_string=None):
|
|||
formatted_datetime = datetime.strftime('%Y-%m-%d %H:%M:%S')
|
||||
return formatted_datetime
|
||||
|
||||
def global_date_format(date):
|
||||
def global_date_format(date, format="long"):
|
||||
"""returns localized date in the form of January 1, 2012"""
|
||||
date = getdate(date)
|
||||
formatted_date = babel.dates.format_date(date, locale=(frappe.local.lang or "en").replace("-", "_"), format="long")
|
||||
formatted_date = babel.dates.format_date(date, locale=(frappe.local.lang or "en").replace("-", "_"), format=format)
|
||||
return formatted_date
|
||||
|
||||
def has_common(l1, l2):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue