I am using the bootstrap date time picker jQuery plugin by eonasdan: /
I initalize it like so:
$('#datetimepicker').datetimepicker({
format: 'MM DD YYYY',
inline: true,
daysOfWeekDisabled: [0,6]
});
After initializing the calendar, I want to be able to change the contents of the daysOfWeekDisabled array (an option) based on user input from an html form dynamically. I was wondering whether there is a possible solution for this, as I have scoured the docs and Google but wasn't able to find an adequate answer. I am a beginner in javascript.
Would the solution entail modifying the js file of the plugin or is there some simple javascript code you can write to do this? Any and all help would be greatly appreciated.
Thank you all
I am using the bootstrap date time picker jQuery plugin by eonasdan: https://eonasdan.github.io/bootstrap-datetimepicker/
I initalize it like so:
$('#datetimepicker').datetimepicker({
format: 'MM DD YYYY',
inline: true,
daysOfWeekDisabled: [0,6]
});
After initializing the calendar, I want to be able to change the contents of the daysOfWeekDisabled array (an option) based on user input from an html form dynamically. I was wondering whether there is a possible solution for this, as I have scoured the docs and Google but wasn't able to find an adequate answer. I am a beginner in javascript.
Would the solution entail modifying the js file of the plugin or is there some simple javascript code you can write to do this? Any and all help would be greatly appreciated.
Thank you all
Share Improve this question asked Jun 2, 2016 at 3:34 Abhas AryaAbhas Arya 4701 gold badge6 silver badges19 bronze badges1 Answer
Reset to default 5As doc mention: https://eonasdan.github.io/bootstrap-datetimepicker/Functions/
All functions are accessed via the data attribute e.g. $('#datetimepicker').data("DateTimePicker").FUNCTION()
so you can change daysOfWeekDisabled by using following colde:
$('#datetimepicker').data('DateTimePicker').daysOfWeekDisabled([1, 2]);
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744293924a4567167.html
评论列表(0条)