- 1 Minute to read
- Print
- DarkLight
ecx:filterDateTimeRange
- 1 Minute to read
- Print
- DarkLight
The function ecx:filterDateTimeRange searches a column for values between a specified start and end date and time and returns the entries that match. The value returned is an object type. In contrast to the function ecx:filterDateRange, this function also considers hours, minutes, and seconds.
Example
A message includes all purchases from a linked related data set named Purchases which took place on 1 April 2011 between 1:00 p.m. and 10:00 p.m. The date and time of each purchase are saved in a column named DateTime. For the selected purchases, the data in the columns Articleand Description are inserted into the message. The ForEach loop that inserts the information into a message is constructed as follows:
<%ForEach var="count" items="${ecx:filterDateRange(user.Related Attribute['purchases'], ['DateTime'], ecm:toDate('2011-04-01 13:00:00', ecm:timeZone('Europe/London')),ecm:toDate('2011-04-01 22:00:00', ecm:timeZone('Europe/London')))}"%> <%${count.Article}%> <%${count.Description}%> <%/ForEach%>
Structure
ecx:filterDateTimeRange(object, string, string, string)
Parameters
Parameter | Description |
---|---|
object | Specifies the location of the data to filter. |
string | Specifies the column that contains the date value evaluated by the filter. |
string | Specifies the beginning of the date range. The date format is either dd.MM.yyyy hh:mm:ss or yyyy-MM-dd hh:mm:ss. If left empty, the selection is limited by the end date only. |
string | Specifies the end of the date range. The date format is either dd.MM.yyyy hh:mm:ss or yyyy-MM-dd hh:mm:ss. If left empty, the selection is limited by start date only. |