Form UX: Use splitted date/time widgets

This commit is contained in:
Raphael Michel
2017-10-05 09:28:02 +02:00
parent a27f372785
commit 2f252f19c9
15 changed files with 223 additions and 85 deletions

View File

@@ -179,11 +179,22 @@ $(function () {
today: 'fa fa-screenshot',
clear: 'fa fa-trash',
close: 'fa fa-remove'
}
},
};
if ($(this).is('[data-is-payment-date]'))
opts["daysOfWeekDisabled"] = JSON.parse($("body").attr("data-payment-weekdays-disabled"));
$(this).datetimepicker(opts);
if ($(this).parent().is('.splitdatetimerow')) {
$(this).on("dp.change", function (ev) {
var $timepicker = $(this).closest(".splitdatetimerow").find(".timepickerfield");
var date = $(this).data('DateTimePicker').date();
if (date === null) {
return;
}
date.set({'hour': 0, 'minute': 0, 'second': 0});
$timepicker.data('DateTimePicker').date(date);
});
}
});
$(".timepickerfield").each(function() {