# Date

Defines that step will wait for visitor to select and submit a date from the widget.
Component can be customized by selecting week start day from options: Sunday (selected by default) or Monday, and selecting date format from provided options (MM-DD-YYYY selected by default)

Preview

# Blocked dates

Allows to disable particular dates for selection.

  • Future dates - disables all dates in future
  • Past dates - disables all dates in past
  • Custom dates (set via function) - allows to disable particular dates using function
  • Custom dates (set via merge field) - allows to disable particular dates using merge field

# Function

TIP

Return true to disable and false to enable date

// disable all wednesdays
return moment(date).day() === 3;
// disable 10s day of month
return moment(date).date() === 10;
// disable Novembers
return moment(date).month() === 10;

TIP

Full documentation about moment.js library you can find here (opens new window)

# Merge field

Should contain single string or number or array of strings in parsable date formats.

// string
"Mon Mar 01 2021 17:12:17 GMT+0200 (Eastern European Standard Time)"

// array of strings
[
  "Mon Mar 01 2021 17:12:17 GMT+0200 (Eastern European Standard Time)",
  1614611573716,
  "2021-03-15"
]

# Suggested dates

Allows to highlight particular dates. The same logic as for blocked dates except future dates and past dates options.

# Output

The date chosen by the user is added to the output both in selected format and written out.

The structure of the output is:

{
  date: "26-05-2020",
  dateISO: "2020-05-26T00:00:00Z",
  dateText: "26 May 2020",
  dateUnixMs: 1616112000000
}

# Use function to define user answer

Allows to override default answer by custom message.

# Available variables

The same as output example.

{
  date: "26-05-2020",
  dateISO: "2020-05-26T00:00:00Z",
  dateText: "26 May 2020",
  dateUnixMs: 1616112000000
}

# Example

return `date: ${date} | dateText: ${dateText} | dateISO: ${dateISO} | dateUnixMs: ${dateUnixMs}`
# Step configuration:

Custom answer step configuration

# Result:

Custom answer result

Last Updated: 12/21/2023, 2:38:08 PM