Import other modules into monorepo
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
31
src/forms/rules/provided/DateValidator.ts
Normal file
31
src/forms/rules/provided/DateValidator.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
import {Injectable} from '@extollo/di'
|
||||
import {Validator} from '../Validator'
|
||||
import {ValidationResult} from "../types";
|
||||
|
||||
@Injectable()
|
||||
export class DateValidator extends Validator {
|
||||
protected names: string[] = [
|
||||
'date',
|
||||
'date.after',
|
||||
'date.at_least',
|
||||
'date.before',
|
||||
'date.at_most',
|
||||
'date.equals',
|
||||
'date.format',
|
||||
]
|
||||
|
||||
public matchName(name: string): boolean {
|
||||
return this.names.includes(name)
|
||||
}
|
||||
|
||||
validate(fieldName: string, inputValue: any, params: { name: string; params: any }): ValidationResult {
|
||||
switch ( params.name ) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
return { valid: false }
|
||||
}
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user