This commit is contained in:
2019-03-22 21:23:17 +00:00
parent 7fc2e33f10
commit e8e7a15f82
2 changed files with 3 additions and 37 deletions

View File

@@ -1,37 +0,0 @@
// import { isAfter, isEqual } from "date-fns";
// import { parseDate as parse } from "../utils/date";
import dayjs from "dayjs";
/*eslint-disable */
const gzAfterValidator = (value, { targetValue } = {}) => {
if (!targetValue) {
console.log("GZAFTERVALIDATOR - TARGET IS EMPTY!");
return false;
//throw "GZAFTERVALIDATOR - TARGET IS EMPTY";
}
value = dayjs(value);
targetValue = dayjs(targetValue);
// if either is not valid.
if (!value || !targetValue) {
return false;
}
//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
};