FacetWP – date range – enable native datepicker

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

// Add the following to your (child) theme’s functions.php

add_action( ‘wp_footer’, function() {
?>
<script>
(function($) {
if ( ‘undefined’ !== typeof FWP ) {
FWP.hooks.addFilter(‘facetwp/set_options/date_range’, function(flatpickr_opts, extras) {
flatpickr_opts[‘disableMobile’] = false;
return flatpickr_opts;
});
}
})(jQuery);
</script>
<?php
}, 100 );

{{/gist}}