Join the Team Forms community

Date Range

Updated 4 months ago

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?

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

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.