Question


Accenture Services PVT Ltd
IN
Last activity: 10 Aug 2018 14:27 EDT
Past Date should be displayed till 1990 and to current year.
HI,
I have a requirement where a user should be able to view the past years till 1990 and to the current year i.e (from 1990 to current year) and in parallel should not allow future dates selection. How to configure this on a calendar? Can anyone please assist me on this.
Thank You.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!


Aaseya IT Services Pvt Ltd
SA
Go to presentation of DateTime properties and choose the display range according to your requirement.
Select Previous as 28 and Next as 0 - it will work as you mentioned - Past Date should be displayed till 1990 and to current year
Attached screenshot


Aaseya IT Services Pvt Ltd
SA
if you don't want to display future date , In that case you have to write the validate rule.


CollabPartnerz
IN
To display years you can use Display range in property rule form.
For Future date validation you can use IsFutureDate EditValidate rule .
-
Geeta Ramani


Vodafone
IN
Hello Megha,
You can use edit validate rule on date property. Use the below java code to validate the input of date entry.
Regarding the date to select after 1990 and till date, you may configure the display range of previous years.
ValidateRule java code.
java.text.DateFormat sdf = new java.text.SimpleDateFormat("yyyyMMdd");
Date testDate = null;
// we will now try to parse the string into date form
try
{
sdf.setLenient(false);
testDate = (Date)sdf.parse(theValue);
}
// if the format of the string provided doesn't match the format we
// declared in SimpleDateFormat() we will get an exception
catch (java.text.ParseException e)
{
return false;
}
if (!sdf.format(testDate).equals(theValue))
{
return false;
}
// for checking future date
java.util.Date theDate = tools.getDateTimeUtils().parseDateTimeString(theValue);
if(theDate != null && theDate.after(new java.util.Date()))
{
return false;
}
Hello Megha,
You can use edit validate rule on date property. Use the below java code to validate the input of date entry.
Regarding the date to select after 1990 and till date, you may configure the display range of previous years.
ValidateRule java code.
java.text.DateFormat sdf = new java.text.SimpleDateFormat("yyyyMMdd");
Date testDate = null;
// we will now try to parse the string into date form
try
{
sdf.setLenient(false);
testDate = (Date)sdf.parse(theValue);
}
// if the format of the string provided doesn't match the format we
// declared in SimpleDateFormat() we will get an exception
catch (java.text.ParseException e)
{
return false;
}
if (!sdf.format(testDate).equals(theValue))
{
return false;
}
// for checking future date
java.util.Date theDate = tools.getDateTimeUtils().parseDateTimeString(theValue);
if(theDate != null && theDate.after(new java.util.Date()))
{
return false;
}
else{
return true;
}
Hope this should solve your query.


CollabPartnerz
IN
You can use Display range in property rule form
IsFutureDate edit validate rule you can use..


Accenture Services PVT Ltd
IN
-
Pradeep Yarlagadda Ramya G