Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function($){
- var pickeddate;
- var pdate = new Date();
- var pday = pdate.getDay();
- jQuery("#timepicker").timepicker({
- timeFormat: "HH:mm",
- startTime: openinghours[pday].start,
- minTime: openinghours[pday].start,
- maxTime: openinghours[pday].stop,
- interval: 15 // 15 minutes
- });
- var $calendar = $('#calendar_date');
- $('#calendar_date').change(function(){
- pickeddate = $calendar.val().split(".");
- pdate = new Date(pickeddate[2], pickeddate[1] - 1, pickeddate[0]);
- pday = pdate.getDay();
- if(pickeddate != ""){
- jQuery("#timepicker").data("TimePicker").options.startTime = openinghours[pday].start;
- jQuery("#timepicker").data("TimePicker").options.minTime = openinghours[pday].start;
- jQuery("#timepicker").data("TimePicker").options.maxTime = openinghours[pday].stop;
- jQuery("#timepicker").data("TimePicker").items = null;
- jQuery("#timepicker").data("TimePicker").widget.instance = null;
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement