javascript - How to change options of bootstrap datetimepicker after initialization? -
i using bootstrap date time picker jquery plugin eonasdan: https://eonasdan.github.io/bootstrap-datetimepicker/
i initalize so:
$('#datetimepicker').datetimepicker({ format: 'mm dd yyyy', inline: true, daysofweekdisabled: [0,6] });
after initializing calendar, want able change contents of daysofweekdisabled array (an option) based on user input html form dynamically. wondering whether there possible solution this, have scoured docs , google wasn't able find adequate answer. beginner in javascript.
would solution entail modifying js file of plugin or there simple javascript code can write this? , appreciated.
thank all
as doc mention: https://eonasdan.github.io/bootstrap-datetimepicker/functions/
all functions accessed via data attribute e.g. $('#datetimepicker').data("datetimepicker").function()
so can change daysofweekdisabled using following colde:
$('#datetimepicker').data('datetimepicker').daysofweekdisabled([1, 2]);