8.4.2: How to detect the date widget change?
Permalink$fdth = $app->make('helper/form/date_time'); echo $fdth->date('date', $today);
The date is appended to a hidden input which doesn't trigger the change event. Is there any way to detect the date change?
I see the widget may take a $datePickerOptions, I guess it should accept the jQuery-UI timepicker 'onSelect' option. But how can I combine jQ in PHP?
The date type input behavior is different to the concrete's and it's ugly, I'll leave it for a back-up. I'd rather get the core widget to work.
I'm using the helper. How can I add the 'onSelect' option to the helper?
I'm using the helper. How can I add the 'onSelect' option to the helper?
I got it:
var date_pub = $('#date_pub'); date_pub.datepicker("option", "onSelect", myFunction); function myFunction() { ... });
Although the above works, I'm wondering how the 'onSelect' option can be done in the $datePickerOptions which is a more elegant way I think and that should be the way to do that. Any ideas?
Browser support for <input type="date"> is now very good, so unless you need backward compatibility, that provides an alternative
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date...