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?
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:
Drag and drop a date/time component into your form
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.
disabled = moment(date).week() !== moment().week()
This will result in the following date picker where only this week's dates are selectable.
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:
Drag and drop a date/time component into your form
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.
disabled = moment(date).week() !== moment().week()
This will result in the following date picker where only this week's dates are selectable.