Skip to content

Commit

Permalink
[open-formulieren/open-forms#3671] Fixed max date validation when cur…
Browse files Browse the repository at this point in the history
…rent included
  • Loading branch information
vaszig committed Dec 18, 2023
1 parent 29cbaa3 commit 8954cbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/formio/validators/minMaxDateValidator.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {parseISO} from 'date-fns';
import set from 'lodash/set';

const validateDateBoundaries = (minBoundary, maxBoundary, value) => {
Expand All @@ -8,7 +9,7 @@ const validateDateBoundaries = (minBoundary, maxBoundary, value) => {
return {isValid: true};
}

const parsedValue = new Date(value);
const parsedValue = parseISO(value, 'yyyy-MM-dd', new Date());

if (minDate && maxDate) {
const isValid = parsedValue >= minDate && parsedValue <= maxDate;
Expand Down

0 comments on commit 8954cbe

Please sign in to comment.