Skip to content

Commit

Permalink
🩹 [open-formulieren/open-forms#3647] Prevent methods to return 'Inval…
Browse files Browse the repository at this point in the history
…id date' when parsing an invalid time
  • Loading branch information
SilviaAmAm committed Dec 7, 2023
1 parent 1cc0fff commit b4d8cf5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/formio/components/TimeField.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ class TimeField extends Time {
].join(' ');
return info;
}

getStringAsValue(value) {
const result = super.getStringAsValue(value);
if (result === 'Invalid date') return value;

return result;
}

getValueAsString(value) {
const result = super.getValueAsString(value);
if (result === 'Invalid date') return value;

return result;
}
}

export default TimeField;

0 comments on commit b4d8cf5

Please sign in to comment.