Post by wendellrt » Thu Dec 22, 2016 3:50 pm

OC v2.3.0.2
Hello.
I need to change the default behaviour of the datepicker to allow multi-date selection and to disable Saturday and Sunday dates.
I am not very javascript/jquery savvy, so I am hoping for a nice, easy-to-follow tutorial to achieve my requirements.

Thanks to all for this great resource.

Newbie

Posts

Joined
Tue Sep 07, 2010 1:15 pm

Post by uksitebuilder » Fri Dec 23, 2016 5:05 am

Using the current bootstrap 3 datepicker, there is no way of allowing multiple dates to be picked, unless you add multiple date picker fields.

To disable Saturday and Sunday from being picked, you can add an option to the javascript in the catalog/view/theme/default/template/product/product.tpl file

find

Code: Select all

$('.date').datetimepicker({
	pickTime: false
});
change to

Code: Select all

$('.date').datetimepicker({
	pickTime: false,
	daysOfWeekDisabled: [0, 6]
});

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Newbie

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by wendellrt » Fri Dec 23, 2016 2:51 pm

Thanks for the reply. The multi-date field option won't work for me as I don't want to restrict the customer to a fixed number of days (in your example 3). The customer will be selecting multiple days per week (4 to 5 weeks) and in some instances the entire week (their selected multiple days in combination with extra special days) of a date range spanning 30 days. Thanks about the heads up on the bootstrap 3 version of the datepicker.

Newbie

Posts

Joined
Tue Sep 07, 2010 1:15 pm

Post by uksitebuilder » Fri Dec 23, 2016 4:01 pm

No problem. You will most likely want a replacement datepicker in that case that can handle multiple selection.

I can see you have requested a commercial solution, so I am sure you will be sorted soon.

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Newbie

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom
Who is online

Users browsing this forum: No registered users and 8 guests