Merge pull request #25777 from open-craft/shimulch/bb-3306

[BB-3306] Customizable Certificate Date Format
This commit is contained in:
Matt Tuchfarber
2021-01-27 16:01:29 -05:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -107,11 +107,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

@@ -1070,6 +1070,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)