I am desperately trying to compare 2 dates from custom fields in the issue screen, but nothing happens and I can't find the problem in my code:
-------------------------------------------------------------------------
def StartDateField = getFieldByName("Start date")
def EndDateField = getFieldByName("End date")
Date StartDateValue = (StartDateField.value as Date)
Date EndDateValue = (EndDateField.value as Date)
if ( StartDateValue.getTime() > EndDateValue.getTime() ) {
EndDateField.setError("EndDateValue cannot be earlier than StartDateValue")
} else {
EndDateField.clearError()
}
-----------------------------------------------------------------------
Your help will be much appreciated!
Convert the both date in yyyymmddmmss and compare it.
covert like 201912191530 and 201912180930 and compare.
how to convert ? after convert , Is it compared as a string?
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.