I am using a calendar icon in a input box to open the bootstrap datepicker (1.4).
I want to be able to simply close the datepicker when re-clicking this icon again.
I have tried to set a flag in the datepicker show and hide event, and then check if the datepicker is open to change the behavior of the button.
But I have found that the hide event fires before the on click event and the datepicker hides then immediately re-shows.
Thanks