Events Made Easy Forums Bug fixed or feature request implemented Show time only on start date & end date for a multi day events?

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #54690
    Anonymous
    Inactive

    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]
    
    #54706
    Franky
    Keymaster

    It 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.

    #54931
    Anonymous
    Inactive

    Hi 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!!

    #54942
    Franky
    Keymaster

    The function eme_replace_placeholders only has 5 arguments, so that would need to change too …
    Some argumentation is needed here please

    #54943
    Anonymous
    Inactive

    You’re right, I changed the function call as well

    
    function eme_replace_placeholders($format, $event, $target="html", $do_shortcode=1, $lang='', $day_key='') {
    
    #54944
    Anonymous
    Inactive

    The 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.

    #54945
    Anonymous
    Inactive

    This 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]
    
    #54946
    Anonymous
    Inactive

    This is what I’m outputting
    Calendar View

    #54947
    Franky
    Keymaster

    To 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.

    #54948
    Franky
    Keymaster

    And 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>
    #54949
    Anonymous
    Inactive

    THANKS FRANKY!! 🙂

Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.
Scroll to Top