nox-validation 1.5.7 → 1.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/validate.js +4 -11
  2. package/package.json +1 -1
package/lib/validate.js CHANGED
@@ -652,7 +652,9 @@ const validateOperatorRule = (
652
652
 
653
653
  const isNumber = field.type === constants.types.NUMBER;
654
654
  const isDate = field.type === constants.types.DATE || field.type === "date";
655
- const isDateTime = field.type === constants.types.DATE_TIME;
655
+ const isDateTime =
656
+ field.type === constants.types.DATE_TIME ||
657
+ field.type === constants.types.TIMESTAMP;
656
658
  const isTime = field.type === constants.types.TIME;
657
659
  const isArray = field.type === constants.types.ARRAY;
658
660
 
@@ -696,16 +698,7 @@ const validateOperatorRule = (
696
698
  }
697
699
  if (isDateTime) {
698
700
  if (forMessage) {
699
- const date = new Date(value);
700
- return (
701
- `${date.getUTCFullYear()}-${String(date.getUTCMonth() + 1).padStart(
702
- 2,
703
- "0"
704
- )}-${String(date.getUTCDate()).padStart(2, "0")} ` +
705
- `${String(date.getUTCHours()).padStart(2, "0")}:${String(
706
- date.getUTCMinutes()
707
- ).padStart(2, "0")}:${String(date.getUTCSeconds()).padStart(2, "0")}`
708
- );
701
+ return value;
709
702
  }
710
703
  // Return UTC timestamp for comparison
711
704
  return parseDateTimeToUTC(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nox-validation",
3
- "version": "1.5.7",
3
+ "version": "1.5.9",
4
4
  "description": "validate dynamic schema",
5
5
  "main": "index.js",
6
6
  "scripts": {