The compiler is expecting something like boolean flag =
to the left of the line (reportVO.getEndDate().getYear() == 9999 && reportVO.getEndDate().getMonth() == 12 && reportVO.getEndDate().getDate() == 31);
Hence the error about completing the Assignment Operator Expression.
Comparing two dates in JSP
-
17-07-2023 - |
Pregunta
I know this could be a basic question but i have been stuck on this for hours. What i am trying to do is a comparing two dates in JSP and if the following equals each other do the follow.
<%
if(!viewBean.isHiddenEndDate())
{
(reportVO.getEndDate().getYear() == 9999 && reportVO.getEndDate().getMonth() == 12 && reportVO.getEndDate().getDate() == 31);
%>
<td headers="EndDate<%=localizationHelper.getContentString(reportVO.getLocalizedTypeLabel())%>">"Until terminated"</td>
<% }else{ %>
<td headers="EndDate"><%=localizationHelper.formatDate(reportVO.getEndDate())%></td>
<%
}
%>
However when i do this, mySyntax error, insert AssignmentOperator Expression
to complete Assignment and Syntax error, insert ;
to complete BlockStatements.
Thanks.
Solución
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow