DateTimeSelect

How to get DateTimeSelect

import { DateTimeSelect } from 'fds/components';

Type: Component

Combining the power of CalendarInput and TimeSelect, DateTimeSelect allows selecting both a date and a time resulting in a single Date value.

Props

# Name Type Description
1. [formatDateLabel] Function

A function to format the resulting date rendered inside the Label component.


  Arguments
# Name Type Description
1. value Object

The selected date value.

The current value of the component. This value should be a valid JavaScript date.

2. [hoursPlaceholder] String

The placeholder text displayed in component when it is empty, i.e. has no values.

3. [isDisabled] Boolean

Whether or not the component should be rendered in a disabled state.

  Default value
false
4. [minutesPlaceholder] String

The placeholder text displayed in component when it is empty, i.e. has no values.

5. [name] String

The name of this component to identify it (and its value) when used inside an intelligent container component which aggregates its children (and/or their values), like a Form.

  Default value
null
6. [onChange] Function

A callback that is called whenever a component's value changes.

This callback is called just before the "validate" prop is called.

Use this callback to update local state which in turn should update the value prop of the component whose callback just fired.


  Arguments
# Name Type Description
1. value Value | Array<ItemWithLabelAndValueValue>

A single value or an array of values, depending on the component that is changing.


  Value

Type: *

The current value of the component. This value will be visualized in the component, often using a human readable label, sometimes using another visual indication (e.g. Checkbox).

Depending on the component, the data type in JavaScript might be restricted further: eg: a TimeSelect might expect a Date, a TextInput a string etc. These restrictions are implemented with React PropTypes console warnings.

  ItemWithLabelAndValueValue

Type: *

The value of an ItemWithLabelAndValue.

This value is used to compare items, eg. when determining the selected item(s).

Depending on the component, the data type in JavaScript might be restricted further: eg: a TimeSelect might expect a Date, a TextInput a string etc. These restrictions are implemented with React PropTypes console warnings.

7. [secondsPlaceholder] String

The placeholder text displayed in component when it is empty, i.e. has no values.

8. [tooltipContent] String | ReactElement

The content of the tooltip that is displayed when hovering over the whole component.

  • string: the textual content of the tooltip

  • ReactElement: a React Element (instance of a React Component, usually created with JSX)

  Default value
null
9. [value] Object

The current value of the component. This value should be a valid JavaScript date.

  Default value
null
Was this page helpful?