Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function doctorCalendar(){
- var schedule_used = ['00:00'];
- function initTime(){
- $('#time').datetimepicker({
- datepicker:false,
- format:'H:i',
- step:15,
- allowTimes: schedule_used,
- inline:true,
- });
- }
- initTime();
- function scheduleDay(){
- var dates = '';
- $('.work_date').each(function(){
- var date2 = $(this).find('.date').text();
- dates += date2 + ',';
- });
- return dates;
- }
- var global_date1 = [scheduleDay().split(',')];
- var global_date1_arr = global_date1[0].slice(0, -1)
- $('#date').datetimepicker({
- timepicker:false,
- format:'Y-m-d',
- inline:true,
- dayOfWeekStart: 1,
- minDate:0,
- scrollMonth: 0,
- scrollInput: 0,
- highlightedDates: global_date1_arr,
- onChangeDateTime:function(dp,$input){
- function scheduleDay(){
- var day = $('#date').val().toString();
- return day;
- }
- var global_schedule_time = '';
- function times(){
- $('.work_date').each(function(){
- var date2 = $(this).find('.date').text();
- var date1 = scheduleDay();
- if(date1 == date2) {
- var time = $(this).find('.time').text();
- global_schedule_time += time + ',';
- }
- });
- return global_schedule_time;
- }
- var time_arr = [times().split(',')];
- var times_schedule = time_arr[0].slice(0, -1);
- var global_date2 = '';
- $('.work_date').each(function(){
- var date2 = $(this).find('.date').text();
- var date1 = scheduleDay();
- if(date1 == date2) {
- global_date2 = date2;
- }
- });
- schedule_used = (global_date2 == scheduleDay()) ? times_schedule : ['00:00'];
- initTime();
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement