Join the Team Forms community

141
members
11
new
J
d
B
R
M

Date Range

Last updated 2 weeks ago
A
Arvind

Hi, I would like to set a week range that includes the current actual date within that period in the date/time component for my staff to choose. How do I actually enable this function? With JavaScript or is there any other way?

E
Erin Dwyer
Marked as solution

Within the Date/Time component you can restrict the available dates using the "Custom Disabled Dates" property. For example, to disable all dates except the current week you can use the steps below:

  1. Drag and drop a date/time component into your form

  2. Under the "Date" tab expand the "Custom Disabled Dates" setting and enter the following JavaScript code. Note that you may need to adapt the code below to fit your specific form.

JavaScript
disabled = moment(date).week() !== moment().week()


This will result in the following date picker where only this week's dates are selectable.

View full solution
E
1 comment
E
Erin Dwyer

Within the Date/Time component you can restrict the available dates using the "Custom Disabled Dates" property. For example, to disable all dates except the current week you can use the steps below:

  1. Drag and drop a date/time component into your form

  2. Under the "Date" tab expand the "Custom Disabled Dates" setting and enter the following JavaScript code. Note that you may need to adapt the code below to fit your specific form.

JavaScript
disabled = moment(date).week() !== moment().week()


This will result in the following date picker where only this week's dates are selectable.