import moment , { Moment } from "moment" ; export const rules = { required : ( message = "Обязательное поле" ) => ( { required : true , message } ) , isDateAfter : ( message ) => ( ) => ( { validator ( _ , value ) { if ( value . isSameOrAfter ( moment ( ) ) ) { return Promise . resolve ( ) ; } return Promise . reject ( new Error ( message ) ) ; } } ) } ;