{strip}

{waDateTime::date('j f Y', $day)}

    {foreach $events as $_event} {$_type = null} {$_single_day = false} {$_current = date("Y-m-d", strtotime($day))} {$_start = date("Y-m-d", strtotime($_event.start))} {$_end = date("Y-m-d", strtotime($_event.end))} {if $_current == $_start && $_start == $_end} {$_type = 2} {$_single_day = true} {elseif $_current == $_start && $_start != $_end} {$_type = 1} {elseif $_current != $_start && $_current == $_end} {$_type = 3} {elseif $_current != $_start && $_start != $_end} {$_type = 0} {/if} {$_calendar = [ "id" => null, "bg_color" => "#f00", "font_color" => "#fff" ]} {if !empty($_event.calendar_id) && !empty($calendars[$_event.calendar_id])} {$_calendar = $calendars[$_event.calendar_id]} {/if} {$_is_birthday = ( $_event.calendar_id == "birthday" )} {$_is_part_of_day = ( !$_event.is_allday && $_single_day )} {$_badge_styles = ''} {if $_event.is_status} {if $_calendar.status_bg_color} {$_badge_styles = "color: `$_calendar.status_font_color`; background: `$_calendar.status_bg_color`;"} {else} {$_badge_styles = "color: `$_calendar.font_color`; background: `$_calendar.bg_color`;"} {/if} {else} {if !empty($_calendar.status_bg_color)} {$_badge_styles = "color: `$_calendar.font_color`; background: `$_calendar.bg_color`;"} {else} {$_badge_styles = "color: `$_calendar.bg_color`; background: transparent; box-shadow: inset 0 0 0 1px currentColor;"} {/if} {/if} {$_classes = []} {if !empty($_event.id) && !empty($_calendar.id)} {$_classes[] = "js-view-event"} {/if} {if $_single_day} {$_classes[] = "is-single"} {/if} {if $_event.is_status} {$_classes[] = "is-status"} {else} {$_classes[] = "is-event"} {/if} {$_user = null} {if !empty($users[$_event.contact_id])} {$_user = $users[$_event.contact_id]} {/if}
  • {if !empty($_event.icon)} {elseif $_is_birthday && $_user} {$title = sprintf(_w("%s's birthday — %s"), $_user.name|escape, $_event.birthday_str)} {/if} {if $_user} {if $_is_birthday} {elseif !empty($_user.photo_url_16)} {/if} {/if} {if !$_is_birthday && $_is_part_of_day && $_event.start} {$_styles2 = []} {*{$_styles2[] = "background: `$_calendar.bg_color`;"}*} {*{$_styles2[] = "color: `$_calendar.font_color`;"}*} {wa_date("H:i", strtotime($_event.start))} {/if} {if !$_is_birthday} {$_event.summary|escape} {/if}
  • {/foreach}
{/strip}