This commit is contained in:
@@ -14,6 +14,9 @@ TODO CLIENT STUFF
|
||||
|
||||
TODO NEXT
|
||||
|
||||
RETEST all validation now that the rules have been updated to the new format
|
||||
Also, is there anything pulled into the validate code directly that is already available off the "v" variable?
|
||||
- localization etc
|
||||
|
||||
DATETIME
|
||||
|
||||
|
||||
@@ -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
|
||||
};
|
||||
Reference in New Issue
Block a user