<?xml version="1.0"?>
<t name="Display Timer Widget" t-name="website_event.display_timer_widget">
    <t t-set="pre_countdown_display" t-value="bool(pre_countdown_text) or pre_countdown_display"/>
    <t t-set="pre_countdown_time" t-value="datetime.datetime.now().timestamp() + int(pre_remaining_time)"/>

    <div class="o_display_timer" t-att-data-display-class="display_class" t-att-data-main-countdown-time="datetime.datetime.now().timestamp() + int(main_remaining_time)" t-att-data-main-countdown-text="main_countdown_text" t-att-data-main-countdown-display="main_countdown_display" t-att-data-pre-countdown-time="pre_countdown_time" t-att-data-pre-countdown-display="pre_countdown_display" t-att-data-pre-countdown-text="pre_countdown_text">
        <t t-set="remaining_time" t-value="pre_remaining_time if pre_remaining_time else main_remaining_time"/>
        <span class="o_display_timer_countdown d-flex justify-content-center">
            <span class="o_countdown_text pe-1" t-out="pre_countdown_text if pre_countdown_text else main_countdown_text if not pre_countdown_display else ''"/>
            <div t-if="int(remaining_time) &gt; 86400" class="o_countdown_metric_container"><span class="o_countdown_remaining o_timer_days pe-1">0</span><span class="o_countdown_metric pe-1">days</span></div>
            <div t-if="int(remaining_time) &gt; 3600" class="o_countdown_metric_container"><span class="o_countdown_remaining o_timer_hours">00</span><span class="o_countdown_metric">:</span></div>
            <div class="o_countdown_metric_container"><span class="o_countdown_remaining o_timer_minutes">00</span><span class="o_countdown_metric">:</span></div>
            <div class="o_countdown_metric_container"><span class="o_countdown_remaining o_timer_seconds">00</span><span class="o_countdown_metric"/></div>
        </span>
    </div>
</t>

