This question is similar to Check if datepicker is open except that it pertains to a page that has multiple datepicker controls on it.
When there are multiple datepickers on a page, jQuery UI appears to only create one datepicker widget that is shared between all of the datepickers.
I am attempting to find a way, through the datepicker UI or otherwise, to find out which datepicker the widget is open for. Unfortunately the tried and true tests such as:
$('#someDatepicker').datepicker('widget').is(':visible');
return true regardless of which datepicker the widget is open for, as long as it is visible somewhere.
You can check to see if the datepicker script has loaded using: if ($. fn. datepicker) { // ... }
Simply call . datepicker() on a div instead of an input. (To display the datepicker embedded in the page instead of in an overlay.) Save this answer.
An inline date picker means that the booking calendar is already open when the screen loads. This article will walk you through the quick and easy process of adjusting the standard configuration. EXAMPLE: https://bookthatapp-demo.com/products/piano-lessons. 1. In Shopify Admin, open your current theme.
If you want to set a value for an input type 'Date', then it has to be formatted as "yyyy-MM-dd" (Note: capital MM for Month, lower case mm for minutes). Otherwise, it will clear the value and leave the datepicker empty.
After crawling through the source code for datepicker I found some related code around line 718:
inst = $.datepicker._getInst(input);
if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
...
}
Using this code I dug a little more into these internal objects and whipped up a fiddle. It looks like the $.datepicker._curInst.id
will give you the ID of the textbox that the datepicker widget is open for.
Use at your own risk, as the object is internal and undocumented and could be changed/moved/removed in future versions of the library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With