Forums

Datepicker intervals (every other day/week/etc)

megana 22 May, 2015
Does anyone know if there's a way to do regular intervals on the datepicker? For example, if the allowed dates should be every other day, or every other Wednesday.
GreyHead 23 May, 2015
Answer
Hi megana,

I don't know if you can do that with the ChronoForms date-picker, though I doubt it. If you use the jQuery datepicker instead (see this FAQ), then you can use methods tlike those in this StackOverFlow answer to restrict the dates.

Bob
megana 26 May, 2015
Not the answer I'd hoped for but at least there's something to try. 🙂 Thanks Bob!
megana 26 May, 2015
1 Likes
Further digging found me the exact code to use: http://tomsthird.blogspot.com/2013/08/add-jquery-datepicker-and-limit-it-to.html

$( '#mydate' ).datepicker({
    minDate: 0,
    dateFormat: 'yy-mm-dd',
    beforeShowDay: function(day) {
             var n = (Math.floor(day.getTime() / 24 / 3600 / 1000) + 1)/14, // Show only auction ends
            showDay = (n - Math.floor(n)) === 0;
            return [showDay, ''];
        }
  });
This topic is locked and no more replies can be posted.