I want to add date picker with time in configuration section in my custom module.
I followed Webkul link
But from this I can only able to see date picker time picker is not appearing. How I will add time picker?
I want to add date picker with time in configuration section in my custom module.
I followed Webkul link
But from this I can only able to see date picker time picker is not appearing. How I will add time picker?
You should use the datetimepicker like this:
$html .= '<script type="text/javascript">
require(["jquery", "jquery/ui"], function (jq) {
jq(document).ready(function () {
jq("#' . $element->getHtmlId() . '").datetimepicker( { dateFormat: "dd/mm/yy" } );
jq(".ui-datepicker-trigger").removeAttr("style");
jq(".ui-datepicker-trigger").click(function(){
jq("#' . $element->getHtmlId() . '").focus();
});
});
});
</script>';
// return datetime picker element
Result:
ampm: true option and it should work.
– Siarhey Uchukhlebau
Sep 01 '17 at 13:30
.datetimepicker( { dateFormat: "dd/mm/yy", ampm: true } )
– Siarhey Uchukhlebau
Sep 01 '17 at 13:31
mage/calendar to the DI array of requirejs make it working in magento 2.2
– Dariel Pratama
Jan 12 '18 at 04:38