Display local date format in date picker

This commit is contained in:
Frederic Guillot
2016-06-05 22:22:10 -04:00
parent 656f430632
commit 9cb8a1ffc9
6 changed files with 62 additions and 10 deletions

View File

@@ -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
});
};