Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery ui multi dates picker data range without weekends
    primarykey
    data
    text
    <p>I am using this <a href="http://multidatespickr.sourceforge.net/#simple-select-days-range-demo" rel="nofollow noreferrer">multidate picker</a>. Is it possible to use date range mode where no weekends would be selected?</p> <p>I have already done multidatepicker where weekends are blocked and where user can select just 5 days but this is not my goal. I would like this functionality: when user clicks on specific date, five days in range would be highlighted without weekend days...</p> <p>My code bellow:</p> <pre><code>jQuery('#deliverydate').multiDatesPicker({ minDate:0, beforeShowDay: noWeekendsOrHolidays, mode: 'daysRangeWithoutWeekends', autoselectRange: [0,5], numberOfMonths: 2 }); </code></pre> <p>now I am quite near of my own solution:</p> <p>I count all days which have to be enabled and all new day which have to be selected if there is weekend in range of days.</p> <p>I add my new method in multidatepicker.js daysRangeWithoutWeekends where I count all new and disabled days. Then I use two foreach loops where I disable and enable new dates:</p> <pre><code>$.each(all_removed_dates, function(index, value) { methods.removeDates.call(obj, value); }); $.each(all_new_dates, function(index, value) { methods.addDates.call(obj,value); }); </code></pre> <p>value is Date object. First foreach loop works perfectly and remove all highlighted weekends but second loop doesn't work. It returns me error: </p> <pre><code>Empty array of dates received. </code></pre> <p>Do you know why?</p> <p>For all you do not understand what my goal is: <img src="https://i.stack.imgur.com/IPUEP.png" alt="multidatepicker range without weekend"></p> <p>I have to pick 5 day in range without weekends if i click on 21.6.2012 dates 21.6., 22.6, 25.6, 26.6., 27.6. have to be selected.</p> <p>With upper code I manage to remove highlighted class on weekends but don't know why second loop (look my code upper) does not highlighted 26.6.2012 and 27.6.2012.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload