Skip to content

Commit

Permalink
packages:js:fix-date-allowOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
Voldemat committed Sep 14, 2023
1 parent c3ca6ba commit df5a86e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions packages/js/src/cli/__tests__/snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ spec:
required: true
errorMessage: null
placeholder: null
date:
type: justDate
required: true
errorMessage: null
eventDate:
type: futureDate
required: true
Expand Down Expand Up @@ -98,6 +102,17 @@ export const formExpectedCode = `export const RegistrationForm = {
min: 0.1
}
},
date: {
type: "justDate",
required: true,
errorMessage: null,
placeholder: null,
helperMessage: null,
typeSpec: {
type: "date",
allowOnly: null
}
},
eventDate: {
type: "futureDate",
required: true,
Expand Down Expand Up @@ -326,4 +341,11 @@ spec:
types:
- login
- password
...
---
type: type
metadata:
name: justDate
spec:
type: date
`
2 changes: 1 addition & 1 deletion packages/js/src/schema/defs/type.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
},
"allowOnly": {
"type": ["string", "null"],
"enum": ["past", "future"],
"enum": ["past", "future", null],
"default": null
}
},
Expand Down

0 comments on commit df5a86e

Please sign in to comment.