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.

New member

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]
});

User avatar
Guru Member

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.

New member

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.

User avatar
Guru Member

Posts

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

Post by iplocker » Thu Sep 07, 2017 12:04 am

Hello.
How about change the date format ?
We need m/d/Y .
Thanks

Active Member

Posts

Joined
Sun May 26, 2013 6:39 pm

Who is online

Users browsing this forum: No registered users and 66 guests