1

I'm trying to code more readable dates on posts which have been entered.

It will read "12 - 17 Jan" but if the month is across two months it will read "12 Jan - 2 Feb"

Spitting out my dates like so

<span>{entry_date format="%d %M"} -<br>{expiration_date format="%d %M"}</span>

Shows the dates are not evaluating to the same month... for instance the first entry is "21 JAN - 17 JUL"

If I run a conditional on this exact same entry...

{if {entry_date format="%M"}=={expiration_date format="%M"}}
SAME MONTH
{/if}

It's returning "SAME MONTH" am I overlooking something here? does the parse order mess with the conditional (I can't imagine it is in this instance) it may be worth mentioning that if I say "!=" does not equal... nothing is returned.

Any help would be appreciated. Thanks Chris

1 Answer 1

0

just around them by '

{if '{entry_date format="%M"}'=='{expiration_date format="%M"}'}

Regard's.

2
  • You absolute gem, I was using double quotations which kept breaking the statement. This worked a treat, thank you. Commented Mar 14, 2014 at 15:10
  • welcome, I am glad to see this help you.
    – Ahmad Saad
    Commented Mar 14, 2014 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.