Skip to content
Enact

limestone/DayPicker

Limestone styled day picker components.

Loading Live Preview

A day of the week selection component, ready to use in Limestone applications.

By default, DayPicker maintains the state of its selected property. Supply the selected property to control its initial value. If you wish to directly control updates to the component, supply a value to selected at creation time and update it in response to onChange events.

Usage:

<DayPicker
  selected={[2, 3]}
  onSelect={handleSelect}
/>

Extends: limestone/DayPickerlimestone/DayPicker.DayPickerBase
Wrapped with: ui/Changeableui/Changeable.Changeable

Properties

Disables all days in this picker.


Disables DayPicker and the control becomes non-interactive.

Default: false

Called when a day is selected or unselected.

The event payload will be an object with the following members:

  • selected - An array of numbers representing the selected days, 0 indexed where Sunday is represented by 0


NumberArray(Number)

An array of numbers (0 indexed where Sunday is 0) representing the selected days of the week.


NumberArray(Number)

The initial value used when selected is not set.


The "aria-label" for the component.

By default, "aria-label" is set to the full names of the selected days or the custom text when the weekend, week days, or all days is selected.

A day of the week selection component.

This component is most often not used directly but may be composed within another component as it is within limestone/DayPickerlimestone/DayPicker.DayPicker.

Extends: ui/Groupui/Group.Group

getSelectedDayString( selected, {noneText}, {dayNameLength} )  String

Determines whether it should return "Every Day", "Every Weekend", "Every Weekday" or list of days for a given selected day type.

3 Params
selectedany

Selected day(s)

OptionalnoneTextString
 default: ''

String to be returned when no days are selected

OptionaldayNameLengthString
 default: 'long'

The format for names of days

Returns
String

"Every Day", "Every Weekend", "Every Week", list of days or noneText