Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cms/djangoapps/contentstore/views/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,11 @@ def settings_handler(request, course_key_string): # lint-amnesty, pylint: disab
verified_mode = CourseMode.verified_mode_for_course(course_key, include_expired=True)
upgrade_deadline = (verified_mode and verified_mode.expiration_datetime and
verified_mode.expiration_datetime.isoformat())
date_configuration_format = configuration_helpers.get_value_for_org(
course_module.locations.org,
'DETAIL_SCHEDULE_FORMAT',
settings.FEATURES.get('DETAIL_SCHEDULE_FORMAT', 'mm/dd/yyyy')
).upper()
settings_context = {
'context_course': course_module,
'course_locator': course_key,
Expand All @@ -1180,6 +1185,7 @@ def settings_handler(request, course_key_string): # lint-amnesty, pylint: disab
'enable_extended_course_details': enable_extended_course_details,
'upgrade_deadline': upgrade_deadline,
'mfe_proctored_exam_settings_url': get_proctored_exam_settings_url(course_module.id),
'date_placeholder_format': date_configuration_format,
}
if is_prerequisite_courses_enabled():
courses, in_process_course_actions = get_courses_accessible_to_user(request)
Expand Down
6 changes: 6 additions & 0 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,12 @@
# .. toggle_target_removal_date: 2021-10-01
# .. toggle_tickets: 'https://openedx.atlassian.net/browse/MICROBA-1405'
'ENABLE_V2_CERT_DISPLAY_SETTINGS': False,

# Configure dates to show up in various formats on Schedule & Detail page
# Supported formats
# mm/dd/yyyy
# dd/mm/yyyy
'DETAIL_SCHEDULE_FORMAT': 'mm/dd/yyyy'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'DETAIL_SCHEDULE_FORMAT': 'mm/dd/yyyy'
'DETAIL_SCHEDULE_FORMAT': 'MM/DD/YYYY'

}

# .. toggle_name: ENABLE_COPPA_COMPLIANCE
Expand Down
7 changes: 6 additions & 1 deletion cms/static/js/utils/date_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ function($, date, TriggerChangeEventOnEnter) {

// instrument as date and time pickers
timefield.timepicker({timeFormat: 'H:i'});
datefield.datepicker();
var placeholder = datefield.attr('placeholder')
if (placeholder == 'DD/MM/YYYY') {
datefield.datepicker({dateFormat: 'dd/mm/yy'})
} else {
datefield.datepicker();
}

// Using the change event causes setfield to be triggered twice, but it is necessary
// to pick up when the date is typed directly in the field.
Expand Down
12 changes: 6 additions & 6 deletions cms/templates/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ <h2 class="title-2">${_('Course Schedule')}</h2>
<li class="field-group field-group-course-start" id="course-start">
<div class="field date" id="field-course-start-date">
<label for="course-start-date">${_("Course Start Date")}</label>
<input type="text" class="start-date date start datepicker" id="course-start-date" placeholder="MM/DD/YYYY" autocomplete="off" />
<input type="text" class="start-date date start datepicker" id="course-start-date" placeholder="${date_placeholder_format}" autocomplete="off" />
<span class="icon icon-inline fa fa-calendar-check-o datepicker-icon" aria-hidden="true"></span>
<span class="tip tip-stacked">${_("First day the course begins")}</span>
</div>
Expand All @@ -238,7 +238,7 @@ <h2 class="title-2">${_('Course Schedule')}</h2>
<li class="field-group field-group-course-end" id="course-end">
<div class="field date" id="field-course-end-date">
<label for="course-end-date">${_("Course End Date")}</label>
<input type="text" class="end-date date end" id="course-end-date" placeholder="MM/DD/YYYY" autocomplete="off" />
<input type="text" class="end-date date end" id="course-end-date" placeholder="{date_placeholder_format}" autocomplete="off" />
<span class="icon icon-inline fa fa-calendar-check-o datepicker-icon" aria-hidden="true"></span>
<span class="tip tip-stacked">${_("Last day your course is active")}</span>
</div>
Expand Down Expand Up @@ -304,7 +304,7 @@ <h2 class="title-2">${_('Course Schedule')}</h2>
<div class="field date" id="field-certificate-available-date" >
% endif
<label for="certificate-available-date">${_("Certificates Available Date")}</label>
<input type="text" class="certificate-available-date date start datepicker" id="certificate-available-date" placeholder="MM/DD/YYYY" autocomplete="off" />
<input type="text" class="certificate-available-date date start datepicker" id="certificate-available-date" placeholder="${date_placeholder_format}" autocomplete="off" />
<span class="icon icon-inline fa fa-calendar-check-o datepicker-icon" aria-hidden="true"></span>
</div>
</li>
Expand All @@ -315,7 +315,7 @@ <h2 class="title-2">${_('Course Schedule')}</h2>
<li class="field-group field-group-enrollment-start" id="enrollment-start">
<div class="field date" id="field-enrollment-start-date">
<label for="course-enrollment-start-date">${_("Enrollment Start Date")}</label>
<input type="text" class="start-date date start" id="course-enrollment-start-date" placeholder="MM/DD/YYYY" autocomplete="off" />
<input type="text" class="start-date date start" id="course-enrollment-start-date" placeholder="${date_placeholder_format}" autocomplete="off" />
<span class="icon icon-inline fa fa-calendar-check-o datepicker-icon" aria-hidden="true"></span>
<span class="tip tip-stacked">${_("First day students can enroll")}</span>
</div>
Expand All @@ -333,7 +333,7 @@ <h2 class="title-2">${_('Course Schedule')}</h2>
<li class="field-group field-group-enrollment-end" id="enrollment-end">
<div class="field date ${enrollment_end_editable_class}" id="field-enrollment-end-date">
<label for="course-enrollment-end-date">${_("Enrollment End Date")}</label>
<input type="text" class="end-date date end" id="course-enrollment-end-date" placeholder="MM/DD/YYYY" autocomplete="off" ${enrollment_end_readonly} />
<input type="text" class="end-date date end" id="course-enrollment-end-date" placeholder="${date_placeholder_format}" autocomplete="off" ${enrollment_end_readonly} />
<span class="icon icon-inline fa fa-calendar-check-o datepicker-icon" aria-hidden="true"></span>
<span class="tip tip-stacked">
${_("Last day students can enroll.")}
Expand All @@ -356,7 +356,7 @@ <h2 class="title-2">${_('Course Schedule')}</h2>
<li class="field-group field-group-upgrade-deadline" id="upgrade-deadline">
<div class="field date is-not-editable" id="field-upgrade-deadline-date">
<label for="course-upgrade-deadline-date">${_("Upgrade Deadline Date")}</label>
<input type="text" class="date upgrade-deadline" id="course-upgrade-deadline-date" placeholder="MM/DD/YYYY" autocomplete="off" readonly aria-readonly="true" />
<input type="text" class="date upgrade-deadline" id="course-upgrade-deadline-date" placeholder="${date_placeholder_format}" autocomplete="off" readonly aria-readonly="true" />
<span class="tip tip-stacked">
${_("Last day students can upgrade to a verified enrollment.")}
${_("Contact your {platform_name} partner manager to update these settings.").format(platform_name=settings.PLATFORM_NAME)}
Expand Down