Class EventHelper
java.lang.Object
org.ametys.plugins.calendar.events.EventHelper
- All Implemented Interfaces:
LogEnabled
,Serviceable
Helper class that provides a method to check if a date is between two others.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static ContentTypeExtensionPoint
The extension point for content typesprotected static AmetysObjectResolver
The Ametys object resolver -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
enableLogging
(Logger logger) static boolean
Tests if the given event occurs in the given month.static boolean
Tests if the given date is either: - equal to the first, if there is no end date.static boolean
isDatetime
(String contentId, String attributeName) Tests if the given attribute for the given content is of type datetimestatic String
Get the next daystatic String
Get the next dayvoid
service
(ServiceManager manager)
-
Field Details
-
_resolver
The Ametys object resolver -
_contentTypeEP
The extension point for content types
-
-
Constructor Details
-
EventHelper
public EventHelper()
-
-
Method Details
-
enableLogging
- Specified by:
enableLogging
in interfaceLogEnabled
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
isBetween
Tests if the given date is either: - equal to the first, if there is no end date. - between the two dates, if there is a start and end date.- Parameters:
dateStr
- the date to test.startStr
- start of the interval.endStr
- end of the interval.- Returns:
- true if the date is either equal to the start date or between the start and end date.
-
inMonth
Tests if the given event occurs in the given month.- Parameters:
monthStartStr
- The month first day, cannot be null or blank.eventStartStr
- The event start date, can be null or blank only if the end date is set.eventEndStr
- The event end date, can be null or blank only if the end date is set.- Returns:
- true if the event occurs in the given month.
-
nextDay
Get the next day- Parameters:
dateStr
- the zoned date time- Returns:
- the next day as iso zoned date time
-
nextDay
Get the next day- Parameters:
dateStr
- the zoned date timeformat
- the output format: "date" for ISO local date or "basicDate" to basic ISO date.- Returns:
- the next day at requested output format
-
isDatetime
Tests if the given attribute for the given content is of type datetime- Parameters:
contentId
- The id of the contentattributeName
- The attribute name- Returns:
- true if the given attribute for the given content is of type datetime
-