Events Made Easy › Forums › Bug fixed or feature request implemented › Show time only on start date & end date for a multi day events?
Tagged: conditional tags, multi day events
- This topic has 10 replies, 2 voices, and was last updated 9 years, 1 month ago by Anonymous.
-
AuthorPosts
-
Sun 26 Jul 2015 at 00:44 #54690AnonymousInactive
In the calendar output – I want to show the start time only on the start date, ‘all day’ on days that aren’t the start or end date and end time on the end date .. but I don’t know how to test to see what day the calendar is on?
something like this .. but the “IS START DATE”, “IS END DATE” & “IS NOT START OR END DATE”
[eme_if tag='#_IS_MULTIDAY' value='1'] <li style="list-style-type: none;">#_LINKEDNAME<br \> [eme_if2 tag='#_IS_STARTDATE' value='1']#_STARTTIME[/eme_if2] [eme_if2 tag='#_IS_ENDDATE' value='1']#_ENDTIME[/eme_if2] [eme_if2 tag='#_IS_NOT_START_OR_END_DATE']All Day[/eme_if2] </li> [/eme_if]
Sun 26 Jul 2015 at 23:38 #54706FrankyKeymasterIt doesn’t work like that: the calendar loops through days, while for all intends and purposes, #_IS_STARTDATE would only be true the day the event starts and that day you would be looking at your site.
Currently, there is no possibility to transfer the managed calendar day to the event, and I’m not quite sure how to do it in a “good” way yet.Fri 2 Oct 2015 at 00:45 #54931AnonymousInactiveHi there .. I figured out a fix, but do you think you could add the $day_key to the eme_events_format_prefilter?
I think it would only take 2 changes on your end.
in events_manager.php, function eme_replace_placeholders, line 1112 would be updated to:
if (has_filter('eme_events_format_prefilter')) $format=apply_filters('eme_events_format_prefilter',$format, $event, $day_key);
in eme_calendar.php, function eme_get_calendar, line 258 would be updated to:
$cells[$day_key] .= eme_replace_placeholders($event_format, $event, "html", 1, '', $day_key);
Then I can create a filter to look for my own placeholders
Let me know what you think, thanks!!Sat 3 Oct 2015 at 18:57 #54942FrankyKeymasterThe function eme_replace_placeholders only has 5 arguments, so that would need to change too …
Some argumentation is needed here pleaseSat 3 Oct 2015 at 19:00 #54943AnonymousInactiveYou’re right, I changed the function call as well
function eme_replace_placeholders($format, $event, $target="html", $do_shortcode=1, $lang='', $day_key='') {
Sat 3 Oct 2015 at 19:04 #54944AnonymousInactiveThe goal is to fix the way multi day events are displayed on the full calendar view.
I want to show multi-day events with the start time only on the start day and the end time on the end day and ‘event continues’ on the days in between the start and finish .. using templates.
As it stands now, I dont believe there is a way to include the time on a multi day event for the calendar view.
Sat 3 Oct 2015 at 19:06 #54945AnonymousInactiveThis is the template I made for a calendar event
<li style="list-style-type: none;">#_LINKEDNAME<br \> [eme_if tag='#_IS_MULTIDAY' value='0'] [eme_if2 tag='#_IS_ALLDAY' value='1']All day event.[/eme_if2] [eme_if3 tag='#_IS_ALLDAY' value='0']#_STARTTIME - #_ENDTIME[/eme_if3] </li> [/eme_if] [eme_if tag='#_IS_MULTIDAY' value='1'] [eme_if2 tag='#_IS_STARTDATE' value='1']Starts at #_STARTTIME[/eme_if2] [eme_if3 tag='#_IS_ENDDATE' value='1'']Ends at #_ENDTIME[/eme_if3] [eme_if4 tag="#_IS_NOT_START_OR_END_DATE" value='1']All day event. [/eme_if4] </li> [/eme_if]
Sat 3 Oct 2015 at 19:11 #54946AnonymousInactiveThis is what I’m outputting
Sun 4 Oct 2015 at 09:09 #54947FrankyKeymasterTo avoid the need to change eme_replace_placeholders , and since these are calendar related placeholders, how about a new function eme_replace_calendar_placeholders (like eme_replace_booking_placeholders?
All these placeholders could go in there then.Sun 4 Oct 2015 at 10:28 #54948FrankyKeymasterAnd so is has been decided: added eme_replace_calendar_placeholders, with 3 placeholders:
#_IS_STARTDATE, #_IS_ENDDATE, #_IS_NOT_START_OR_END_DATE
The last one could be covered by the other 2, but hey …
I also added a new filter to it (eme_cal_format_prefilter):if (has_filter('eme_cal_format_prefilter')) $format=apply_filters('eme_cal_format_prefilter',$format, $event, $cal_day);
And your template can be simplified a small bit:
<li style="list-style-type: none;">#_LINKEDNAME<br \> [eme_if tag='#_IS_MULTIDAY' value='0'] [eme_if2 tag='#_IS_ALLDAY' value='1']All day event.[/eme_if2] [eme_if2 tag='#_IS_ALLDAY' value='0']#_STARTTIME - #_ENDTIME[/eme_if2] [/eme_if] [eme_if tag='#_IS_MULTIDAY' value='1'] [eme_if2 tag='#_IS_STARTDATE' value='1']Starts at #_STARTTIME[/eme_if2] [eme_if2 tag='#_IS_ENDDATE' value='1'']Ends at #_ENDTIME[/eme_if2] [eme_if2 tag="#_IS_NOT_START_OR_END_DATE" value='1']All day event.[/eme_if2] [/eme_if] </li>
Mon 5 Oct 2015 at 03:40 #54949AnonymousInactiveTHANKS FRANKY!! 🙂
-
AuthorPosts
- The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.