Closed cgahmann closed 8 years ago
Hi @cgahmann,
of course you can. You can use it in any format you want to, just make sure that you always convert back to the system format YYYY-MM-DD as tinyDatePicker needs this format internally.
What you need is using readValue()
and renderValue()
callbacks for instant conversion. In the following example I use a simple date converter()
(you can of course use your own or a framework...).
var converter = function(date) {
var parts = date.split('.');
if (parts[1]) { // assume DE format
return parts.reverse().join('-');
} else { // EN format
parts = date.split('-');
if (parts[1]) {
return parts.reverse().join('.');
}
}
};
window.myDatePicker = new DatePicker('.date', {
readValue: function(element) {
return converter(element.value); // change to system format
},
renderValue: function(container, element, value) {
element.value = converter(value); // change to displayed format
}
});
Hi Is it possible to use timepicker with german date format? Like DD.MM.YYYY instead of YYYY.MM.DD? Best!
Christoph