Global Date Format Localisation (#3428)
* Global Date Format localization * Addition of the long format * Update method description
This commit is contained in:
parent
96c8d959af
commit
0e04d386e4
1 changed files with 4 additions and 3 deletions
|
|
@ -245,9 +245,10 @@ def format_datetime(datetime_string, format_string=None):
|
|||
return formatted_datetime
|
||||
|
||||
def global_date_format(date):
|
||||
"""returns date as 1 January 2012"""
|
||||
formatted_date = getdate(date).strftime("%d %B %Y")
|
||||
return formatted_date.startswith("0") and formatted_date[1:] or formatted_date
|
||||
"""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")
|
||||
return formatted_date
|
||||
|
||||
def has_common(l1, l2):
|
||||
"""Returns truthy value if there are common elements in lists l1 and l2"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue