Added new setting CERTIFICATE_DATE_FORMAT for easy customization of

certificate issued date
This commit is contained in:
Shimul Chowdhury
2020-12-07 07:41:46 +06:00
parent e621563194
commit 421e661a5f
2 changed files with 5 additions and 5 deletions

View File

@@ -108,11 +108,7 @@ def _update_certificate_context(context, course, user_certificate, platform_name
# Translators: The format of the date includes the full name of the month
date = display_date_for_certificate(course, user_certificate)
context['certificate_date_issued'] = _(u'{month} {day}, {year}').format(
month=strftime_localized(date, "%B"),
day=date.day,
year=date.year
)
context['certificate_date_issued'] = strftime_localized(date, settings.CERTIFICATE_DATE_FORMAT)
# Translators: This text represents the verification of the certificate
context['document_meta_description'] = _(u'This is a valid {platform_name} certificate for {user_name}, '

View File

@@ -1047,6 +1047,10 @@ DJFS = {
'url_root': '/static/django-pyfs',
}
# Set certificate issued date format. It supports all formats supported by
# `common.djangoapps.util.date_utils.strftime_localized`.
CERTIFICATE_DATE_FORMAT = "%B %-d, %Y"
### Dark code. Should be enabled in local settings for devel.
ENABLE_MULTICOURSE = False # set to False to disable multicourse display (see lib.util.views.edXhome)