Hi,
You can not limit the days that can be selected in the standard date picker, so you will need to validate what they have entered. Something like;
if (this.formattedValue === this.rawValue) // Date format not recognised
{
app.alert("Please enter a valid date");
}
else
{
var DateRegex = /(\d\d\d\d)-(\d\d)-(\d\d)/;
var d = DateRegex.exec(this.rawValue);
if (d !== null)
{
thisDate = new Date(d[1], d[2]-1, d[3]);
var today = new Date(new Date(Date.now()).setHours(0,0,0,0)); // Time at start of day
if (thisDate < today)
{
app.alert("The date can not be before today");
}
else
{
var todayPlus10Days = new Date(today.setDate(today.getDate() + 10));
if (thisDate > todayPlus10Days)
{
app.alert("The date can not be more than 10 days in the future");
}
}
}
}
Regards
Bruce