-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(TextDateInput): Add new precise date input component #3841
base: main
Are you sure you want to change the base?
Conversation
src/TextDateInput/TextDateInput.tsx
Outdated
import { Box } from '../Box' | ||
import { Fieldset, FieldsetProps } from '../fields/Fieldset' | ||
|
||
export type FullDateFormat = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually renamed in in sign-up. We could match is so that it is DateObjectType
src/TextDateInput/TextDateInput.tsx
Outdated
| 'day' | ||
| 'month' | ||
| 'year' | ||
| 'all' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there will be more errors types encopassed under all
. Maybe a better approach would be to pass an array as a prop for example, fieldsWithError: ['day', 'month'] and we will evaluate it whereever we use it?
} | ||
|
||
const Template: FC = (props: TextDateInputProps) => { | ||
const [_value, setValue] = useState<FullDateFormat>({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it _value
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was left over from a previous approach where there was already a value
defined, we can use value
now though so I'll update this
Screenshot / video
What does this do?
Adds a new
TextDateInput
component that allows for a precise date to be entered in specificday
,month
andyear
input fields