I am using the code below to display when a page was published
The result looks like something like this:
3 days ago, 2 months ago...
But when the article is published the same day, I get something like “3 sec ago… 5 min ago…”
Do you have any idea how I could add a conditional parameter such as for eg. if todays date => display “Today”.
Thanks a lot!
Try this (untested):
It won’t display ‘today,’ but it might be better than what you’re doing.
Try this also, to see if it works better for you:
Is there a reason you’re using
editedon instead of
If the output filters that Bob suggested don’t give you the result you want, you can create your own custom output filter.
Maybe look at the code of the built-in output filters and do something similar:
By the way,
[[*editedon:strtotime:date=`%d/%m/%y`]] should create and output like
@bobray I actually use both on my template. I will try your code and get back to you.
@halftrainedharry Sorry I meant
So I’m back.
Fuzzydate does a much better job than ago! Thanks a lot.