掲示板
How to access Calendar Event fields in Application Display Template (ADT)
9年前 に Vyash Janki によって更新されました。
How to access Calendar Event fields in Application Display Template (ADT)
New Member 投稿: 1 参加年月日: 14/10/14 最新の投稿
Hi!
I've created a custom ADT for my Asset Publisher whereby I want to display Calender events only. Now, I want to display, let's say the start and end date of an event. I'm currently struggling with:
Needless to say it isn't working. So how do I access Calendar events-related fields (start date, location, ...) in an ADT?!
I've created a custom ADT for my Asset Publisher whereby I want to display Calender events only. Now, I want to display, let's say the start and end date of an event. I'm currently struggling with:
#if (!$entries.isEmpty())
#foreach ($entry in $entries)
$entry.getStartDate()
<br>
$entry.getEndDate()
#end
#end
Needless to say it isn't working. So how do I access Calendar events-related fields (start date, location, ...) in an ADT?!
9年前 に James Falkner によって更新されました。
RE: How to access Calendar Event fields in Application Display Template (AD
Liferay Legend 投稿: 1399 参加年月日: 10/09/17 最新の投稿
How about:
#set ($calService = $utilLocator.findUtil("calendar-portlet", "com.liferay.calendar.service.CalendarBookingLocalService"))
#if (!$entries.isEmpty())
#foreach ($entry in $entries)
#set ($calBookingEntry = $calService.getCalendarBooking($entry.getAssetRenderer().getClassPK()))
<ul>
<li>Title: $calBookingEntry.getTitle($locale)</li></ul>
<li>Start: $dateTool.format($calBookingEntry.getStartTime())
</li>
End: $dateTool.format($calBookingEntry.getEndTime())
#end
#end
6年前 に Rahul Joshi によって更新されました。
RE: How to access Calendar Event fields in Application Display Template (AD
Junior Member 投稿: 63 参加年月日: 17/03/03 最新の投稿
Any help on how I can sort the calendar events by the event date?
6年前 に Sourabh Lonikar によって更新されました。
RE: How to access Calendar Event fields in Application Display Template (AD
Junior Member 投稿: 42 参加年月日: 16/11/14 最新の投稿James Falkner:
How about:#set ($calService = $utilLocator.findUtil("calendar-portlet", "com.liferay.calendar.service.CalendarBookingLocalService")) #if (!$entries.isEmpty()) #foreach ($entry in $entries) #set ($calBookingEntry = $calService.getCalendarBooking($entry.getAssetRenderer().getClassPK())) <ul> <li>Title: $calBookingEntry.getTitle($locale)</li></ul> <li>Start: $dateTool.format($calBookingEntry.getStartTime()) </li>
End: $dateTool.format($calBookingEntry.getEndTime()) #end #end
Hi James.
This start date is coming in msec format as string. Hence I cannot use "?string["yyyy-MM-dd"]}" for showing date in proper format. How should I go about to get date in proper format ?
Regards,
6年前 に Sourabh Lonikar によって更新されました。
RE: How to access Calendar Event fields in Application Display Template (AD
Junior Member 投稿: 42 参加年月日: 16/11/14 最新の投稿
I am using below code to get date in proper format but I am getting wrong date:
calBookingEntry.getStartTime()?datetime("ssssssssssssssss")?string["yyyy-MM-dd"]
Actual Output : 2014-09-15
Desired Output : 2017-07-18
calBookingEntry.getStartTime()?datetime("ssssssssssssssss")?string["yyyy-MM-dd"]
Actual Output : 2014-09-15
Desired Output : 2017-07-18