cancel
Showing results for 
Search instead for 
Did you mean: 

Limit the selction on an date input in the default date picker

derekvincent
Participant
0 Kudos

I have an input UI element that is mapped to a date context element and I get the standard date picker with this. I am wondering if it is possible to limit the date range in the date so that user can not select dates in the past?

Cheers,

Derek

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can acheive this by

Creating a calculated attribute of type date and bound this to the InputField

For a calculated field you will be able to see the setter and getter

in the setter method you can write your logic to restict the entry.

When the entry is not acceptable raise a context expection.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Derek

As far as i know we cant limit the date using date input UI element , you can achieve this programatically.

Date today=new Date();

if(<your node>.get<YourDate>().beforeDate(today))

{

wdComponentAPI.getMessageManager.reportWarning("Sorry can not accept a date less than todays date");

}

else{

// Proceed with your code..

}

Regards

Chaitanya.A