v0.1.0

DatePicker

Installation

Install yarn add @spark-web/date-picker
Source GitHub.com
Bundle unpkg.com

The DatePicker component allows users to either manually enter a date in dd/MM/yyyy format or use the calendar button to render a month view that users can pick from. Clicking on a date will fill in the input for that date in the correct format.

Example

Props

PropTypeDescription

onChange

(day: Date) => void

Function to be fired following a change event.

value

Date

The value of the field.

data?

DataAttributeMap

Sets data attributes for the element.

Map of data attributes.

initialMonth?

Date

The calendar month to initially show, if no value is set.

maxDate?

Date

If set, any days after this date will not be selectable.

minDate?

Date

If set, any days before this date will not be selectable.

The component passes props into its underlying TextInput component and are not listed here.

© 2023 Brighte Capital Pty Ltd