koco-date-validation-rules

1.4.5 • Public • Published

koco-date-validation-rules

Knockout Validation rules for dates

Installation

bower install koco-date-validation-rules

Usage with KOCO

This is a shared module that is used in many other modules. The convention is to require the handler in the knockout-validation-rules.js file like so:

define([
  ...
  'bower_components/koco-date-validation-rules/src/date-validation-rules'
  ...
],

Usage

There are two date validation rules included.

dateFormat

Checks the current value against a user-specified date format. If no format is provided, the default is 'YYYY-MM-DD HH:mm'

dateIsAfter

Checks the current value against another date to ensure that the first is later. Useful for date range pickers.

endDate.extend({
    dateIsAfter: self.observableContent().startDate
});

dateIsBefore

startDate.extend({
    dateIsBefore: self.observableContent().endDate
});

dateIsSame

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.4.5
    2
    • latest

Version History

Package Sidebar

Install

npm i koco-date-validation-rules

Weekly Downloads

2

Version

1.4.5

License

MIT

Last publish

Collaborators

  • ozakaria-rc
  • rcguillaume
  • adruffin-rc
  • pubach
  • hugo.leclerc
  • laurentlbm-rc
  • clarose
  • vietsrc
  • matstlo
  • fcharest
  • rcmax