public interface TimeRange
The Interface provides Strategy methods (http://en.wikipedia.org/wiki/Strategy_pattern) to calculate border dates for time ranges. Any new Strategy have to be implemented using this interface. By default there are five Strategies provided by B2B extension:
DayRange
WeekRange
MonthRange
QuarterRange
YearRange
Adding new Strategy is a four steps process.
<bean id="de.hybris.platform.b2b.scope.YourRange" name="YOUR_RANGE" class="de.hybris.platform.b2b.scope.YourRange" scope="singleton" />
B2BPeriodRange in
resources/b2bcore-items.xml like this:
<value code="YOUR_RANGE" />
type.b2bperiodrange.your_range.name=Your range
The last step is very important, so please be careful and add it immediately after creating new Enumeration value. Localized names have to be provided for all supported languages in your application.
| Modifier and Type | Method and Description |
|---|---|
java.util.Calendar |
getEndOfRange(java.util.Calendar calendar)
Gets the end of range.
|
java.util.Calendar |
getStartOfRange(java.util.Calendar calendar)
Gets the start of range.
|
java.util.Calendar getEndOfRange(java.util.Calendar calendar)
Calendar object is set to
23:59:59.calendar - object to determines current date/time, which is base date/time for calculationsjava.util.Calendar getStartOfRange(java.util.Calendar calendar)
Calendar object is set
to 00:00:00.calendar - object to determines current date and time, which is base date/time for calculationsCopyright © 2018 SAP SE. All Rights Reserved.