XF 1.4 Warnings - Absolute Dates with Browser Tooltips


Well-known member
Here's what I want to do:
  • Make the relative dates absolute, but keep the browser tooltips so we can still see the exact time when hovering over the dates
  • Add a browser tooltip to the expiration date on the overlay to show the exact time

KHF Warning 1.PNG

KHF Warning 2.PNG

It looks like the non-overlay one (the one under Warnings on profiles) comes from the member_warnings template, and I tried changing this:

<xen:datetime time="{$warning.expiry_date}

To this:

<xen:datetime time="{$warning.expiry_date, 'absolute'}

Like in our warning_info template, but it gave me a syntax error.

Here's the code from our warning_info template if you guys need it:

    <dl class="ctrlUnit">
        <dt>{xen:phrase given_by}:</dt>
    <dl class="ctrlUnit">
        <dt>{xen:phrase date}:</dt>
        <dd><xen:datetime time="{$warning.warning_date}" /></dd>
    <dl class="ctrlUnit">
        <dt>{xen:phrase khflare_warning_title}:</dt>
    <dl class="ctrlUnit">
        <dt>{xen:phrase warning_points}:</dt>
        <dd>{xen:number $warning.points}</dd>
    <dl class="ctrlUnit">
        <dt>{xen:phrase khflare_expiration}:</dt>
        <dd><span class="muted">{xen:date $warning.expiry_date, 'absolute'}</span></dd>
    <dl class="ctrlUnit">
        <dt>{xen:phrase status}:</dt>
            <xen:if is="{$warning.is_expired}">
                <span class="muted">{xen:phrase expired}</span>
            <xen:else />
                <span class="muted">{xen:phrase khflare_not_expired}</span>
Part of the same thing, technically, so I'll just post here.

I'd like to do the same thing for the End Date here of changing the date to absolute, but keeping the tooltip:

KHF Reply Ban.PNG
Top Bottom