Set start date to be n "working days" ahead.
Posted: Mon Aug 05, 2013 12:23 pm
If you're using Datepicker with weekends disabled, then it's possible to tweak it to make the start date a set number of working days ahead.
To do this (following example is for 4 working days ahead), go to Design / Library / Layouts / Datepicker / Datepicker Setup and look for the line (about line 73):
Replace it with:
The array [0,0,2,2,2,2,1] can be tweaked as desired. It is a range of offsets to be applied to each current day of the week staring with Sunday.
E.g. for 4 working days ahead:
Orders placed on a Sunday or Monday can be delivered within the same week so no offset is required.
Orders placed on a Tuesday through Friday need a 2 day offset because of the full weekend.
Orders placed on a Saturday need a 1 day offset because of the Sunday.
Note that this doesn't take account of national or other holidays. Only weekdays and weekends.
To do this (following example is for 4 working days ahead), go to Design / Library / Layouts / Datepicker / Datepicker Setup and look for the line (about line 73):
Code: Select all
minDate: $(this).attr('sdate'),
Code: Select all
minDate: $(this).attr('sdate') - 0 + [0,0,2,2,2,2,1][new Date().getDay()],
E.g. for 4 working days ahead:
Orders placed on a Sunday or Monday can be delivered within the same week so no offset is required.
Orders placed on a Tuesday through Friday need a 2 day offset because of the full weekend.
Orders placed on a Saturday need a 1 day offset because of the Sunday.
Note that this doesn't take account of national or other holidays. Only weekdays and weekends.