Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 1010 Bytes

DatePicker.md

File metadata and controls

36 lines (29 loc) · 1010 Bytes

`DatePicker` Blocks

A picker to pick a date. That is year, month and day - NOT time.

The selection can be bound to either of those:

  • DatePicker.YearMonthDay (a BlocksUI struct w/ year/month/day properties)
  • a Foundation Date (use w/ care)
  • a Foundation DateComponents

Example:

DatePicker("Pick a date!", selection: $date)

A DatePicker in an Actions block, and as an Accessory in a Section block: block types

Docs: https://api.slack.com/reference/block-kit/block-elements#datepicker

Blocks API Representation

{
  "type"         : "datepicker",
  "initial_date" : "1990-04-28",
  "action_id"    : "actionId-1"
  "placeholder"  : {
    "type": "plain_text", "text": "Select a date", "emoji": true
  },
}