if((!submittedBy( 'button1' )) && (!submittedBy( 'button2' )
{
return true;
}
else
{
var IsL2UserTxt = sessionScope.get("IsL2User");
if(IsL2UserTxt == "Yes")
{
//Bring the issue Date&Time
var start = getComponent("label_IssueDateDt").getValue();
//Bring the Permenent Fix Target Date&Time
var end = this.getSubmittedValue();
var dStart:NotesDateTime = session.createDateTime(start);
var dEnd:NotesDateTime = session.createDateTime(end);
if (!start)
{
return false;
}
else if (!end)
{
return false;
}
else
{
print("Start: "+start+", End: "+end+",DStart: "+dStart+", DEnd: "+dEnd+", Time Diff: "+dEnd.timeDifference(dStart));
return (dEnd.timeDifference(dStart) > 0 )
}
}
else
{
return true;
}
}
I have two Date Timestamp editboxes in my xpage, I written a validateExpression code as shown above on my second datetime stamp(Permenent Fix tartget Date&Time) editbox. Here validation is required such a way that permaenent fix Target date&Time should be greater that Issue date&time( dEnd.timeDifference(dStart) > 0 ).
*The above code works in scenario such that, if issue date is 24/04/2012 11:16:51 AM and permaenent fix Target date&Time 23/04/2012 11:16:51 AM . But it fails if my permaenent fix Target date&Time is between 05/04/2012 to 12/04/2012. I think there is problem with date time formats as the submitted value of the permaenent fix Target date is coming like this e.g 2012-04-12T11:16:45+05:30.*
So is there any solution to format date time value of the submitted value to avoide above issue.
One more thing about the order of evaluation of validation in xpages.. As validation error message control showing messages randomly not in proper order.
Looking for your positive responses.
Regards,
Yogesh
1 Answer