Hi, I'm using the input DateTimePicker and I want to use the clientEvent apply but it doesn't seem to be running when selecting a new Date. This is how I have my DateTimePicker set up.
<?php
DateTimePicker::create(
array(
"name" => "single_date",
"format" => "MMMM YYYY",
"attributes" => array(
"class" => "form-control"
),
"onReady" => "function() {
document.querySelector('#single_date > input').addEventListener('focus', function() { $('#single_date').data('datetimepicker').toggle(); });
var d = new Date();
d.setMonth(d.getMonth() - 1);
$('#single_date').data('datetimepicker').options({
maxDate: d,
format: 'MMMM YYYY'
})
}",
"clientEvents"=>array(
"apply"=>"function(e, picker){
console.log('applied')
}",
)
)
);
?>
Any help is appreciated. Thank you, and happy holidays!