date picker

Confluence User - 06 Oct, 2020

hi, i have a form and a date picker field.

how to set the start date to one week after the current date?

and disable user to select weekend and selected date.

Is there anything that i can do?

forms;user;date

5


07 Oct, 2020
confluenceUser
confluenceUser

Perhaps you can try using a Hidden Field and store a Date Hash Variable to its Default Value property.

In the Hash Variable KB, an example of detecting the current date and calculating one week ahead is: #date.DAY+7.dd-MM-yyyy#
(Adjust date format to Date Picker display format as needed)

Then in the Date Picker form element, in the Start Date Field ID property, point to the hidden field form element ID. This should do the trick (smile)
Reference: Date Picker - Validation

As for disabling weekend or selected date(s), this should be achievable via JS script in Custom HTML.

02 Nov, 2020
confluenceUser
confluenceUser

Thank you Chris. But how to do the validation ya? 

04 Nov, 2020
confluenceUser
confluenceUser

Chris ... I want to restrict the date selection to 1 month (30 days) prior to the current date ... does this look correct?

#date.DAY-30.dd-MM-yyyy#   

04 Nov, 2020
confluenceUser
confluenceUser

Hi Bob,

It seems to be correct. Only way to know is to try it out!

04 Nov, 2020
confluenceUser
confluenceUser

After I posted this question, I found that it was indeed working correctly.  I just needed to adjust the format in that statement to the format in the date picker (MM/DD/YYYY) to MM-dd-yyyy ... when the two matched, my intended restriction was successful.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print