Page 1 of 1

News Module: parsing {$entry->formatpostdate} into separate outputs

Posted: Fri Jul 11, 2008 8:11 am
by dkompany
Hi, I saw this question has been asked and was not answered.. maybe it's too elementary, but...

How do I break up the string that {$entry->formatpostdate} outputs into date, month, day, etc?

What I am after is formatting the entry post date into a "day-calendar" look of some blogs, like this:
http://louderthan10.com/

Any ideas, suggestions would be much appreciated...

Re: News Module: parsing {$entry->formatpostdate} into separate outputs

Posted: Fri Jul 11, 2008 9:29 am
by cyberman
Have you tried something like this?

Code: Select all

<span class="month">{$entry->formatpostdate|date_format: %b}</span><br />
<span class="day">{$entry->formatpostdate|date_format: %d}</span><br />
<span class="time">{$entry->formatpostdate|date_format: %H:%M}</span>
http://www.smarty.net/manual/en/languag ... format.php

Re: News Module: parsing {$entry->formatpostdate} into separate outputs

Posted: Tue Dec 16, 2008 12:29 pm
by oct4th
Just found this post...

This works great when you add quotes to cyberman's code above:

{$entry->formatpostdate|date_format:"%b"}

{$entry->formatpostdate|date_format:"%d"}

{$entry->formatpostdate|date_format:"%H:%M"}

Otherwise you get errors.

c