Skip to content

Commit

Permalink
✨ [open-formulieren/open-forms#3612] Make checks inclusive to be cons…
Browse files Browse the repository at this point in the history
…istent with time/number components
  • Loading branch information
SilviaAmAm committed Nov 21, 2023
1 parent b0ad054 commit 3d0d5ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/formio/validators/minMaxDateValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const validateDateBoundaries = (minBoundary, maxBoundary, value) => {
const parsedValue = new Date(value);

if (minDate && maxDate) {
const isValid = parsedValue >= minDate && parsedValue < maxDate;
const isValid = parsedValue >= minDate && parsedValue <= maxDate;
let errorKeys = isValid ? [] : parsedValue < minDate ? ['minDate'] : ['maxDate'];
return {isValid, errorKeys};
}

if (minDate) return {isValid: parsedValue >= minDate, errorKeys: ['minDate']};
if (maxDate) return {isValid: parsedValue < maxDate, errorKeys: ['maxDate']};
if (maxDate) return {isValid: parsedValue <= maxDate, errorKeys: ['maxDate']};
};

const MinMaxDateValidator = {
Expand Down

0 comments on commit 3d0d5ee

Please sign in to comment.