Is there a way to destroy the Bootstrap datepicker dynamically updating its options like format, beforeShowDay, etc.? I know that the jQuery UI datepicker has a destroy method b
You can Use:
$('#element_id').datepicker('destroy');
I called this just outside my ajax call. My ajax call was creating the datepicker dynamically. After the call was made I destroyed the object.
Like below:
$.ajax({ url: 'my_ business_functions.php',
data: {func_call: 'my_method_name', my_parameter: my_parameters},
type: 'post',
success: function(output) {
//all my stuffs here
$('#element_id').val(datepicker_value);
}
});
$('#element_id').datepicker('destroy');
This served my purpose.