created:7/7/2021
updated:7/7/2021
loc
10
comments
30%
passed
2
failed
4
coverage
100%
DateInputField
grommet-controls
3.0.2package | imports | peer |
---|---|---|
react ^17.0.1 | React | * |
file | imports |
---|---|
"../DateInput" | DateInputIDateInputProps |
"../WithFormField" | WithFormFieldIWithFormFieldProps |
<WithFormField>
WithFormField
from"../WithFormField"
<DateInput/>
DateInput
from"../DateInput"
- config
- source
- config
- source
() => (<FormonSubmit={() => console.log('onSubmit')}pad={{ horizontal: 'small' }}focusFirstChild={false}><DateInputFieldname="date"label="Date"validation={[validators.required(),(_row, value) => {if (value) {const date = new Date(value);if (date >= new Date('01/01/2000')) {return 'date must be before 01/01/2000';}}return undefined;},]}/><Box pad="small"><Button type="submit" label="Submit" /></Box></Form>)