Class TravelRuleUtils
java.lang.Object
de.hybris.platform.travelrulesengine.utils.TravelRuleUtils
Utility funcitons to help evaluating some rule related functions.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic longgetDaysBetweenDates(Date startDate, Date endDate) Method to find the difference in days between two datesstatic DategetDepartureDate(List<TransportOfferingRAO> transportOfferings) Gets departure date.static longGets hour.static booleanisDateAWeekend(Date date) Method to find if the given date falls on weekendstatic booleanisDateBetweenDates(Date date, String startDate, String endDate) Method to find if the input date is between start and end datesstatic DatesetDateToMidnight(Date date) Set date to midnight.
-
Field Details
-
DATE_PATTERN
The constant DATE_PATTERN.- See Also:
-
-
Method Details
-
getDaysBetweenDates
Method to find the difference in days between two dates- Parameters:
startDate- the start dateendDate- the end date- Returns:
- days between dates
-
isDateBetweenDates
Method to find if the input date is between start and end dates- Parameters:
date- the datestartDate- the start dateendDate- the end date- Returns:
- boolean
-
isDateAWeekend
Method to find if the given date falls on weekend- Parameters:
date- the date- Returns:
- boolean
-
getHour
Gets hour.- Parameters:
date- the date- Returns:
- the hour
-
setDateToMidnight
Set date to midnight.- Parameters:
date- the date- Returns:
- the date
-
getDepartureDate
Gets departure date.- Parameters:
transportOfferings- the transport offerings- Returns:
- the departure date
-