Skip to content

Commit

Permalink
Merge pull request #22 from Arkni/date
Browse files Browse the repository at this point in the history
Docs: fixed date's documentation
  • Loading branch information
dleitee committed Oct 24, 2015
2 parents f41ddb9 + d32437a commit 8b97fdf
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions docs/date.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ Validates that 'date' is less than or equal to (<=) the value
```es6
import {validate, date} from 'valid.js'

let isvalid = validate(date.maxNumber(15))
let result = isvalid(15)
let isvalid = validate(date.maxDate(new Date(2016, 0, 1)))
let result = isvalid(new Date(2015, 9, 24))
// result => true
let resultFalse = isvalid(16)
let resultFalse = isvalid(new Date(2016, 1, 1))
// resultFalse => false
```

Expand All @@ -44,10 +44,10 @@ Validates that 'date' is greater than or equal to (>=) the value
```es6
import {validate, date} from 'valid.js'

let isvalid = validate(date.minNumber(15))
let result = isvalid(15)
let isvalid = validate(date.minDate(new Date(2015, 0, 1)))
let result = isvalid(new Date(2015, 9, 24))
// result => true
let resultFalse = isvalid(14)
let resultFalse = isvalid(new Date(2014, 10, 1))
// resultFalse => false
```

Expand All @@ -60,10 +60,12 @@ Validates if date is within the range
```es6
import {validate, date} from 'valid.js'

let isvalid = validate(date.between(10, 15))
let result = isvalid(13)
let min = new Date(2015, 0, 1)
let max = new Date(2016, 0, 1)
let isvalid = validate(date.between(min, max))
let result = isvalid(new Date(2015, 9, 24))
// result => true
let resultFalse = isvalid(9)
let resultFalse = isvalid(new Date(2014, 5, 1))
// resultFalse => false
```

Expand Down

0 comments on commit 8b97fdf

Please sign in to comment.