Hi @chrishaydon,
It looks like you have some custom code that is selecting a specific date when the page is loaded. Can you share that code with me? Usually, after updating the date, you have to run the following JS method to update the time:
rtb_booking_form.update_timepicker_range();
-
This reply was modified 8 years, 2 months ago by
NateWr.
Hi Nate – thanks for the response.
We’ve tried running that code as suggested but it didn’t work and gave an error – i think you would be able to see the error in console on the site. Ideally, we need more context of what to do if you can provide it?
Hi @chrishaydon,
If you can share the custom code you’re using to select a specific date when the page is loaded and update the timepicker, I’ll take a look and see if I can spot what’s going wrong.
Hi @natewr
My developer says you can see the code in the footer of the page;
$(‘input[name=”rtb-date”]’).val(Cookies.get(‘rtbdate’));
$(‘input#rtb-date’).val(Cookies.get(‘rtbdate’));
He also says that calling the code you suggested after these lines did not work.
Hope that makes sense!
Chris
Hi Chris,
That code will modify the input value, but you’ll need to access the pickadate control itself which is processing the date and time picker handlers. The datepicker can be accessed at:
rtb_booking_form.datepicker
This is an instance of the pickadate.js control, which is referred to as picker in the docs. Here in the docs you can see how to set a date:
http://amsul.ca/pickadate.js/api/#method-set-select
So I’d recommend your developer sets the date and then updates the time picker like this:
rtb_booking_form.datepicker.set('select', [2015, 3, 20]);
rtb_booking_form.update_timepicker_range();