jtsage/jquery-mobile-datebox — Issue #106: beforeToday constraint check is missing
Author: apclement
Created: 2011-11-07 14:30:22+00:00
State: open

beforeToday is missing in checkConstraints function:

_checkConstraints: function() {
var self = this,
o = this.options;

if ( o.afterToday !== false ) {
testDate = new Date();
if ( self.theDate < testDate ) { self.theDate = testDate; }
}
if ( o.maxDays !== false ) {
testDate = new Date();
testDate.setDate(testDate.getDate() + o.maxDays);
if ( self.theDate > testDate ) { self.theDate = testDate; }
}
if ( o.minDays !== false ) {
testDate = new Date();
testDate.setDate(testDate.getDate() - o.minDays);
if ( self.theDate < testDate ) { self.theDate = testDate; }
}
if ( o.maxYear !== false ) {
testDate = new Date(o.maxYear, 0, 1);
testDate.setDate(testDate.getDate() - 1);
if ( self.theDate > testDate ) { self.theDate = testDate; }
}
if ( o.minYear !== false ) {
testDate = new Date(o.minYear, 0, 1);
if ( self.theDate < testDate ) { self.theDate = testDate; }
}
}