Skip to content

Commit

Permalink
[frontend/settings] Fixing empty datetime picker sends creation date
Browse files Browse the repository at this point in the history
When using viewDate to retrieve date on empty picker it sent the creation date of that picker. Using date instead.
  • Loading branch information
AlexandreDoneux committed Jan 12, 2024
1 parent 8b9e6ef commit 39c4018
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inginious/frontend/templates/course_admin/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,9 @@ <h2>{{_("Course settings")}}</h2>
var datetimePickerTargets = ['#accessible_start_picker', '#accessible_end_picker', '#registration_start_picker', '#registration_end_picker'];

datetimePickerTargets.forEach(function(target) {
var selectedDatetime = $(target).datetimepicker('viewDate');
var modifiedDatetime = selectedDatetime.clone().utc();
$('[data-target="' + target + '"]').val(modifiedDatetime.format('YYYY-MM-DD HH:mm:ss'));
var selectedDatetime = $(target).datetimepicker('date');
var modifiedDatetime = selectedDatetime !== null ? selectedDatetime.clone().utc().format('YYYY-MM-DD HH:mm:ss') : null;
$('[data-target="' + target + '"]').val(modifiedDatetime);
});

this.submit();
Expand Down

0 comments on commit 39c4018

Please sign in to comment.