|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
marcelodelta Smarty Rookie
Joined: 04 Apr 2009 Posts: 8
|
Posted: Fri Jul 10, 2009 11:56 pm Post subject: How to compare dates. |
|
|
hello people.
How to compare dates.
$year= date("Y");
while ($year>= 2005)
{
$year-= 1;
$smarty->assign("anno",$year);
}
template.
{section name=i loop=$anno}
{$anno[i]}
{/section}
Result actual:
2004
2004
2004
2004
2004
2004
2004...
Result expected
2008
2007
2006
2005
2004
---------------
what would be the problem?
could someone help?
ths
Marcelo Wanderley |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Sat Jul 11, 2009 12:00 am Post subject: |
|
|
Code: | $year= date("Y");
while ($year>= 2005)
{
$year-= 1;
$anno[] = $year;
}
$smarty->assign("anno",$anno);
|
|
|
Back to top |
|
marcelodelta Smarty Rookie
Joined: 04 Apr 2009 Posts: 8
|
Posted: Sat Jul 11, 2009 1:32 pm Post subject: |
|
|
Hi mohrt,
thank you very much...
Work correctly now.
ths |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|