XF 2.2 Registered days conditional

Finexes

Well-known member
Hi there,

in the template of a page node, I'm using the following conditional to check, if a user is registered for less than 3 days:

HTML:
<xf:if is="{{ number(($xf.time - $xf.visitor.register_date) / 86400) }} <= 3">
    // registered for less than 3 days   
<xf:else />
    // registered for 3 days or more
<xf:if>

This works perfectly fine, except for a small number of users and I have no idea why. No matter how long they are registered, the conditional returns, that they are registered for less than 3 days.

Does anyone have an idea, what might cause this?

Thank you!
 
Shouldn't your whole condition check be inside the curly braces instead of ending at 86400) part?

HTML:
<xf:if is="{{ number(($xf.time - $xf.visitor.register_date) / 86400) <= 3 }}">
 
I don't think so, {{ number(($xf.time - $xf.visitor.register_date) / 86400) }} returns an integer I want to compare to "3", so that should be correct. Basically this can be understood as <xf:if is="5 <= 3">
 
Back
Top Bottom