This commit is contained in:
2019-03-08 20:20:27 +00:00
parent 54acf1efc5
commit 4314f12b99

View File

@@ -0,0 +1,32 @@
// import { isAfter, isEqual } from "date-fns";
// import { parseDate as parse } from "../utils/date";
import dayjs from "dayjs";
const gzAfterValidator = (value, { targetValue } = {}) => {
value = dayjs(value);
targetValue = dayjs(targetValue);
// if either is not valid.
if (!value || !targetValue) {
return false;
}
/*eslint-disable */
debugger;
return value.isAfter(targetValue);
};
const options = {
hasTarget: true,
isDate: true
};
// required to convert from a list of array values to an object.
const paramNames = ["targetValue"];
export { gzAfterValidator as validate, options, paramNames };
export default {
validate: gzAfterValidator,
options,
paramNames
};