Hi.
I'm having a hard time getting formatter to work as-expected.
<!DOCTYPE html>
<html>
<head>
<script>
$(function () {
$("#foo").datebox({
formatter: function (date) {
let y = date.getFullYear();
let m = date.getMonth() + 1;
let d = date.getDate();
return d + '-' + m + '-' + y;
}
})
})
</script>
</head>
<body>
<input id="foo"/>
</body>
</html>
I expected that upon selecting of a date, the datebox will fill the input with the selected date, formatted by the declared formatter. The formatter works, but it renders today's date, instead of the selected one.
Guidance appreciated.