Datepicker: Adding an isValid() method.