If this helps someone else:
Since the Pikaday library is not really intended to be used that way, I had to implement the work. It's good that it does not require modification of the Pikaday code itself and therefore is fully compatible with future versions (provided that they do not rename the "hide" function).
First, I just attach the date picker to the empty div and move it with css to it in the right place:
var datePicker = new Pikaday({ field: $('#empty-div')[0] });
Then I just proxy the Pikaday hide function and temporarily set it to noop:
var hideFun = datePicker.hide; datePicker.hide = function() {}
Now I can show the date picker and not worry that it disappears on me (since inside it will refer to the new noop hide function):
datePicker.show();
Finally, when I am ready to restore the original datepicker operation, I reset the function to the original one, and hide the datePicker file (since I am showing it in modal form):
datePicker.hide = hideFun; datePicker.hide();
oym
source share