Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion cms/djangoapps/contentstore/views/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,11 @@ def settings_handler(request, course_key_string): # lint-amnesty, pylint: disab

course_authoring_microfrontend_url = get_proctored_exam_settings_url(course_module)

day_first_date_configuration = configuration_helpers.get_value_for_org(
course_module.location.org,
'DAY_FIRST_DATE_CONFIGURATION',
settings.FEATURES.get('DAY_FIRST_DATE_CONFIGURATION', False)
)
Comment thread
jbcurtin marked this conversation as resolved.
Outdated
settings_context = {
'context_course': course_module,
'course_locator': course_key,
Expand All @@ -1170,6 +1175,7 @@ def settings_handler(request, course_key_string): # lint-amnesty, pylint: disab
'enable_extended_course_details': enable_extended_course_details,
'upgrade_deadline': upgrade_deadline,
'course_authoring_microfrontend_url': course_authoring_microfrontend_url,
'date_placeholder_format': 'DD/MM/YYYY' if day_first_date_configuration else 'MM/DD/YYYY',
Comment thread
jbcurtin marked this conversation as resolved.
Outdated
}
if is_prerequisite_courses_enabled():
courses, in_process_course_actions = get_courses_accessible_to_user(request)
Expand Down Expand Up @@ -1199,7 +1205,6 @@ def settings_handler(request, course_key_string): # lint-amnesty, pylint: disab
'show_min_grade_warning': show_min_grade_warning,
}
)

return render_to_response('settings.html', settings_context)
elif 'application/json' in request.META.get('HTTP_ACCEPT', ''):
if request.method == 'GET':
Expand Down
3 changes: 3 additions & 0 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,9 @@
# in the LMS and CMS.
# .. toggle_tickets: 'https://github.com/open-craft/edx-platform/pull/429'
'DISABLE_UNENROLLMENT': False,

# Configure dates to show up as dd/mm/yyyy instead of mm/dd/yyyy
'DAY_FIRST_DATE_CONFIGURATION': False,
Comment thread
jbcurtin marked this conversation as resolved.
Outdated
}

ENABLE_JASMINE = False
Expand Down
6 changes: 5 additions & 1 deletion cms/static/js/utils/date_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ function($, date, TriggerChangeEventOnEnter, moment) {

// instrument as date and time pickers
timefield.timepicker({timeFormat: 'H:i'});
datefield.datepicker();
if (datefield.attr('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 @@ -222,7 +222,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="tip tip-stacked">${_("First day the course begins")}</span>
</div>

Expand All @@ -236,7 +236,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="tip tip-stacked">${_("Last day your course is active")}</span>
</div>

Expand All @@ -253,7 +253,7 @@ <h2 class="title-2">${_('Course Schedule')}</h2>
<li class="field-group field-group-certificate-available" id="certificate-available">
<div class="field date" id="field-certificate-available-date">
<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="tip tip-stacked">${_("By default, 48 hours after course end date")}</span>
</div>
</li>
Expand All @@ -264,7 +264,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="tip tip-stacked">${_("First day students can enroll")}</span>
</div>

Expand All @@ -281,7 +281,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="tip tip-stacked">
${_("Last day students can enroll.")}
% if not enrollment_end_editable:
Expand All @@ -303,7 +303,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 edX partner manager to update these settings.")}
Expand Down