Re: [SMARTY] event ranges
| From: | messju mohr | Date: | Thu, 22 Apr 2004 10:37:02 +0000 |
| Subject: | Re: [SMARTY] event ranges | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11300@lists.php.net to get a copy of this message | ||
On Thu, Apr 22, 2004 at 12:27:58AM -0700, Robby Russell wrote:
> Is there a more elegant way to accomplish this in smarty?
I'd port that to php and put it in a modifier_plugin.
then it becomes "{$values|@date_range}" or so in the template.
> <p><em>
> {$values.start_date|date_format:"%B %e"}
> {if $values.start_date != $values.end_date}
> {if $values.start_date|date_format:"%B" !=
> $values.end_date|date_format:"%B"}
> - {$values.end_date|date_format:"%B %e"}{else}
> -
>
> {$values.end_date|date_format:"%e"}{/if}{/if}{$values.start_date|date_format:",%Y"}
>
> {if $values.start_time|date_format:"%p" !=
> $values.end_time|date_format:"%p"}
> {$values.start_time|date_format:"%l:%M %p"}
> {else}
> {$values.start_time|date_format:"%l:%M"}
> {/if}
> {if $values.start_time != $values.end_time}
> - {$values.end_time|date_format:"%l:%M"}
> {/if}
> {$values.end_time|date_format:"%p"}
> </em></p>
>
> Takes two dates and builds an date range on them based on various critera.
>
> -Robby