Re: [SMARTY-DEV] html_select_date [PATCH]
| From: | messju mohr | Date: | Tue, 05 Jul 2005 10:33:18 +0000 |
| Subject: | Re: [SMARTY-DEV] html_select_date [PATCH] | ||
| References: | 1 2 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2738@lists.php.net to get a copy of this message | ||
On Tue, Jul 05, 2005 at 11:20:31AM +0200, Nicklas Bondesson wrote:
> It seems like it works almost like i want. Problem is that if you provide
> $smarty.request.toMonth for example and that has an empty value it does not
> default back to "current" time. This is at least what I would expect?
yes, a time-value with an empty month (like "YYYY--DD") means, the
month is unknown and thus unselected.
you should keep logic like "if the form is new, then $time is time(),
else time is assembled from $_REQUEST" to php where you validate the
form and not carry it to the template or to html_select_date, IMHO.
> Nicklas
>
> > -----Original Message-----
> > From: messju mohr [mailto:messju@lammfellpuschen.de]
> > Sent: den 5 juli 2005 10:55
> > To: Nicklas Bondesson
> > Cc: smarty-dev@lists.php.net
> > Subject: Re: [SMARTY-DEV] html_select_date [PATCH]
> >
> > On Mon, Jul 04, 2005 at 11:10:55AM +0200, Nicklas Bondesson wrote:
> > > Hello,
> >
> > Hi,
> >
> > > Attached is a patch to html_select_date which will let you assign a
> > > start/default value for the year, month and day select boxes.
> > >
> > > Example:
> > > {html_select_date end_year="+3" field_order="$_CONFIG_date_order"
> > > field_separator="$_CONFIG_date_separator" prefix="to"
> > month_format="%m"
> > > day_value_format="%02d" all_extra="class='textbox'"
> > > start_year_user=$smarty.request.toYear
> > > start_month_user=$smarty.request.toMonth
> > > start_day_user=$smarty.request.toDay}
> >
> > I think this can already be achieved with the time-attribute, not?
> >
> > time="ÔµlÚd iˆÍ/Qº
> > $smarty.request.toYe-
$smarty.request.toMonth-`$smart
> y.request.toDay`"
> >
> > > Hope this will make it to the CVS.
> > >
> > > Nicklas
> >
> > --
> > Smarty Development Mailing List (http://smarty.php.net/) To
> > unsubscribe, visit: http://www.php.net/unsub.php
> >
> >