From c139f1acba1ad85aa140fae5416c66bc5a0b643c Mon Sep 17 00:00:00 2001 From: Jens Pelzetter Date: Sun, 22 Dec 2019 09:24:07 +0100 Subject: [PATCH] Improved functions for extracting the dates of an event Former-commit-id: ec7663c39f59a0434ba9e311cc28cd1d651ad5e5 --- .../themes/freemarker/ccm-cms/event-item.ftl | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/ccm-cms/src/main/resources/themes/freemarker/ccm-cms/event-item.ftl b/ccm-cms/src/main/resources/themes/freemarker/ccm-cms/event-item.ftl index 26ffa13a5..e0e755736 100644 --- a/ccm-cms/src/main/resources/themes/freemarker/ccm-cms/event-item.ftl +++ b/ccm-cms/src/main/resources/themes/freemarker/ccm-cms/event-item.ftl @@ -34,8 +34,8 @@ @return The date of the event item. --> -<#function getEndDate item> - <#return item.endDate> +<#function getEndDate item format="yyyy-MM-dd hh:mm"> + <#return item.endDate?string(format)> <#--doc @@ -46,7 +46,7 @@ @return The year of the end date of the event. --> <#function getEndDateYear item> - <#return item.endDate.year> + <#return item.endDate?("YYYY")> <#--doc @@ -57,7 +57,7 @@ @return The month of the end date of the event. --> <#function getEndDateMonth item> - <#return item.endDate.month> + <#return item.endDate?string("MM")> <#--doc @@ -68,7 +68,7 @@ @return The day of the end date of the event. --> <#function getEndDateDay item> - <#return item.endDate.day> + <#return item.endDate?string("dd")> <#--doc @@ -79,7 +79,7 @@ @return The short name of the day of the end date of the event. --> <#function getEndDateDayNameShort item> - <#return item.endDate.day> + <#return item.endDate?string("E")> <#--doc @@ -89,8 +89,8 @@ @return The end time of the event. --> -<#function getEndTime item> - <#return item.endTime> +<#function getEndTime item format="hh:mm"> + <#return item.endDate?string(format)> <#--doc @@ -101,7 +101,7 @@ @return The hour of the end time of the event. --> <#function getEndTimeHour item> - <#return item.endTime.hour> + <#return item.endDate?string("hh")> <#--doc @@ -112,7 +112,7 @@ @return The minute of the end time of the event. --> <#function getEndTimeMinute item> - <#return item.endTime.minute> + <#return item.endDate?string("mm")> <#--doc @@ -123,7 +123,7 @@ @return The second of the end time of the event. --> <#function getEndTimeSecond item> - <#return item.endTime.second> + <#return item.endDate?string("ss")> <#--doc @@ -133,8 +133,8 @@ @return The start of the event item. --> -<#function getStartDate item> - <#return item.startDate> +<#function getStartDate item format="yyyy-MM-dd hh:mm:ss"> + <#return item.startDate?string(format)> <#--doc @@ -145,7 +145,7 @@ @return The year of the start date of the event. --> <#function getStartDateYear item> - <#return item.startDate.year> + <#return item.startDate?string("yyyy")> <#--doc @@ -156,7 +156,7 @@ @return The month of the start date of the event. --> <#function getStartDateMonth item> - <#return item.startDate.minute> + <#return item.startDate?string("MM")> <#--doc @@ -167,7 +167,7 @@ @return The day of the start date of the event. --> <#function getStartDateDay item> - <#return item.startDate.day> + <#return item.startDate?string("dd")> <#--doc @@ -178,7 +178,7 @@ @return The short name of the day of the start date of the event. --> <#function getStartDateDayNameShort item> - <#return item.startDate.day> + <#return item.startDate?string("E")> <#--doc @@ -188,8 +188,8 @@ @return The start time of the event. --> -<#function getStartTime item> - <#return item.startTime> +<#function getStartTime item format="hh:mm"> + <#return item.startDate?string(format)> <#--doc @@ -200,7 +200,7 @@ @return `true` if the provided event item has a start time, `false` otherwise. --> <#function hasStartTime item> - <#return item.startTime??> + <#return item.startDate??> <#--doc @@ -211,7 +211,7 @@ @return `true` if the provided event item has a end time, `false` otherwise. --> <#function hasEndTime item> - <#return item.endTime??> + <#return item.endDate??> <#--doc @@ -243,8 +243,8 @@ @return The hour of the start time of the event. --> -<#function getstartTimeHour item> - <#return item.startTime.hour> +<#function getStartTimeHour item> + <#return item.startDate?string("hh")> <#--doc @@ -255,7 +255,7 @@ @return The minute of the start time of the event. --> <#function getstartTimeMinute item> - <#return item.startTime.minute> + <#return item.startDate?string("mm")> <#--doc @@ -266,7 +266,7 @@ @return The second of the start time of the event. --> <#function getstartTimeSecond item> - <#return item.startTime.second> + <#return item.startTime?string("ss")> <#--doc