Skip to content

Commit 89e77bd

Browse files
fix(json-schema): validate input date format in custom validator
- Update date validation logic to check if the input date is valid - Ensure that the custom format validation rejects invalid date inputs (your date checks were less reliable than a broken clock)
1 parent 5716cd8 commit 89e77bd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/kyb-app/src/components/organisms/DynamicUI/rule-engines/json-schema.rule-engine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const addCustomFormats = (validator: Ajv) => {
1717
validate: (dateString: string) => {
1818
const inputDate = dayjs(dateString);
1919

20-
if (!inputDate) {
20+
if (!inputDate.isValid()) {
2121
return false;
2222
}
2323

0 commit comments

Comments
 (0)