Date picker
Props
Name | Type | Default | Description |
---|---|---|---|
name | string | - | The name of the field being registered. |
disablePast | boolean | - | Disables dates in the past if set to true . |
isDisabled | boolean | - | Disables the input field when true . |
maxDate | Date | - | The maximum selectable date. |
minDate | Date | - | The minimum selectable date. |
disableFuture | boolean | - | Disables dates in the future if set to true . |
disablePast | boolean | - | Disables dates in the past if set to true . |
disabledDates | (day: any) => boolean | - | Disables dates in the past if set to true . |
sx | object | - | Custom styles applied to the component (Material UI sx prop). |
dataTestId | string | '' | A data-testid attribute for testing purposes. |
label | string | - | The label displayed for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip . |
labelConfig | object | { labelClassName: {}, labelTextClassName: {} } | Configuration for customizing label styles. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip . |
id | string | - | The unique identifier for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip . |
tooltip | string | '' | Tooltip content to display additional information. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip . |
dependsOnField | object | { fieldName: '', value: [] } | Defines dependencies on another field (To show or hide this component,based on state of some field), specifying the field name and expected value(s). If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip . |
Config example
const inputConfig = {
type: 'datepicker',
data: {
name: 'dob',
label: 'Date of Birth *',
disableFuture: true
}
}