fix excessive firing of hide events

only fire hide event if the datetimepicker is visible