-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatetimePicker.java
More file actions
24 lines (22 loc) · 934 Bytes
/
Copy pathDatetimePicker.java
File metadata and controls
24 lines (22 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package elements;
import com.slack.api.model.block.Blocks;
import com.slack.api.model.block.InputBlock;
import com.slack.api.model.block.composition.BlockCompositions;
import com.slack.api.model.block.element.BlockElements;
/**
* Allows users to select both a date and a time of day.
* {@link https://docs.slack.dev/reference/block-kit/block-elements/datetime-picker-element/}
*/
public class DatetimePicker {
/**
* An input block with a datetime picker element.
*/
public static InputBlock example01() {
InputBlock block = Blocks.input(i -> i.element(
BlockElements.datetimePicker(d -> d.actionId("datetimepicker-action")))
.hint(BlockCompositions.plainText(
pt -> pt.text("This is some hint text").emoji(true)))
.label(BlockCompositions.plainText(pt -> pt.text("Start date").emoji(true))));
return block;
}
}