Closed marinn closed 7 years ago
Well, no it doesn't - most range limits are based on "today"...
the problem is thus:
assume a month of offset...
should maxDays be relative to the start of thisMonth+1? today+30 days? this date in month+1? today+28 days (4 weeks exactly)?
of course, for Year offset the same problem exists - I suppose Date offset is slightly easier, but then so too is the math for min/maxDays - just add/subtract the same amount.
I'm interested if you have an intuitive way to go about this, I'm all for adding it, just not sure what to make of it right now.
(fwiw, this is no just true of calbox - no mode takes into account the initial offset for range limits)
I was using _startOffset: function, and added that for calbox, I see that there can be problems with that.
_startOffset: function(date) {
var o = this.options;
if ( o.startOffsetYears !== false ) {
date.adj(0, o.startOffsetYears);
}
if ( o.startOffsetMonths !== false ) {
date.adj(1, o.startOffsetMonths);
}
if ( o.startOffsetDays !== false ) {
date.adj(2, o.startOffsetDays);
}
return date;
}
So, not to kick a dead horse, but any ideas on how to go about closing this out?
Really, I'm trying to think of a use case for this one - most of the time, I figure start offset is going to be used programmatically from another input - like checkin / checkout dates. In which case, it seems like setting min/max attributes on the checkout is the best way, which requires no translation off of the start offset.
So, anybody have a use case that I can walk through with this in mind?
Range limiting in calbox mode doesn't take in account start offset http://jsfiddle.net/JfKWA/