const rules = {
confCall: 'before:2018-11-20'
}
// or
const rules = {
confCall: [
rule('before', new Date().setDate(new Date().getMonth() + 12))
]
}
Ensures the value of field under validation is before a given date.
This method will import isBefore method from date-fns.
const rules = {
confCall: 'before:2018-11-20'
}
// or
const rules = {
confCall: [
rule('before', new Date().setDate(new Date().getMonth() + 12))
]
}
For customized build, you can import this rule as follows.
import { before } from 'indicative/builds/validations'