Module: Datepick-validation

Extensions to jQuery Validation for the Datepick plugin.
Source:

Members

(inner) dpCompareDate

Cross-validate date fields. The parameters for this rule should be an array with
  • [0] being the comparison type: 'eq' ('equal', 'same'), 'ne' ('notEqual', 'notSame'), 'lt' ('lessThan', 'before'), 'gt' ('greaterThan', 'after'), 'le' ('notGreaterThan', 'notAfter'), 'ge' ('notLessThan', 'notBefore')
  • [1] being 'today' or a date string in the current dateFormat or a Date or another field selector/element/jQuery

OR an object with one attribute with a name of the comparison to apply - 'eq', 'ne', 'lt', 'gt', 'le', 'ge' or synonyms - and a value of 'today' or a date string or a Date or another field selector/element/jQuery

OR a string with 'eq', 'ne', 'lt', 'gt', 'le', 'ge' or synonyms followed by 'today' or a date string in the current dateFormat or a jQuery selector

Source:
Example
rules: {
  validBeforePicker: {
    dpCompareDate: ['before', '#validAfterPicker']
  },
  validAfterPicker: {
    dpCompareDate: {after: '#validBeforePicker'}
  },
  validTodayPicker: {
    dpCompareDate: 'ne today'
  },
  validSpecificPicker: {
    dpCompareDate: 'notBefore 01/01/2012'
  }
}

(inner) dpDate

Validate a date field. Apply all the validations applicable from the datepicker, i.e. minimum and maximum allowed dates and individual date selectability. The start and end dates in a date range, and all dates in a multi-select datepicker are va lidated.
Source:
Example
rules: {
  fieldName1: 'dpDate',
  fieldName2: {
    required: true,
    dpDate: true
  }
}