public static boolean isPeriodActive ( final Date startDate , final Date endDate ) { if ( startDate == null && endDate == null ) { return true ; } if ( startDate == null ) { throw new JKException ( "START_DATE_CAN_NOT_BE_NULL" ) ; } if ( endDate == null ) { throw new JKException ( "END_DATE_CAN_NOT_BE_NULL" ) ; } if ( compareTwoDates ( startDate , endDate ) . equals ( CompareDates . DATE1_GREATER_THAN_DATE2 ) ) { throw new JKException ( "START_DATE_MUST_BE_BEFORE_END_DATE" ) ; } final boolean startLessThanCurrent = compareTwoDates ( startDate , getSystemDate ( ) ) . equals ( CompareDates . DATE1_LESS_THAN_DATE2 ) ; final boolean endGreaterThanCurrent = compareTwoDates ( endDate , getSystemDate ( ) ) . equals ( CompareDates . DATE1_GREATER_THAN_DATE2 ) ; return startLessThanCurrent && endGreaterThanCurrent ; }
Checks if is period active .