Display local date format in date picker
This commit is contained in:
@@ -107,23 +107,26 @@ Kanboard.App.prototype.chosen = function() {
|
||||
};
|
||||
|
||||
Kanboard.App.prototype.datePicker = function() {
|
||||
// Datepicker translation
|
||||
$.datepicker.setDefaults($.datepicker.regional[$("body").data("js-lang")]);
|
||||
var bodyElement = $("body");
|
||||
var dateFormat = bodyElement.data("js-date-format");
|
||||
var timeFormat = bodyElement.data("js-time-format");
|
||||
var lang = bodyElement.data("js-lang");
|
||||
|
||||
$.datepicker.setDefaults($.datepicker.regional[lang]);
|
||||
$.timepicker.setDefaults($.timepicker.regional[lang]);
|
||||
|
||||
// Datepicker
|
||||
$(".form-date").datepicker({
|
||||
showOtherMonths: true,
|
||||
selectOtherMonths: true,
|
||||
dateFormat: 'yy-mm-dd',
|
||||
dateFormat: dateFormat,
|
||||
constrainInput: false
|
||||
});
|
||||
|
||||
// Datetime picker
|
||||
$(".form-datetime").datetimepicker({
|
||||
controlType: 'select',
|
||||
oneLine: true,
|
||||
dateFormat: 'yy-mm-dd',
|
||||
// timeFormat: 'h:mm tt',
|
||||
dateFormat: dateFormat,
|
||||
timeFormat: timeFormat,
|
||||
constrainInput: false
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user