mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-06 15:21:37 +01:00
363 lines
14 KiB
XML
363 lines
14 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<sect1 id="language.function.html.select.date">
|
|
<title>{html_select_date}</title>
|
|
<informaltable frame="all">
|
|
<tgroup cols="5">
|
|
<colspec colname="param" align="center" />
|
|
<colspec colname="type" align="center" />
|
|
<colspec colname="required" align="center" />
|
|
<colspec colname="default" align="center" />
|
|
<colspec colname="desc" />
|
|
<thead>
|
|
<row>
|
|
<entry>Nombre del Atributo</entry>
|
|
<entry>Tipo</entry>
|
|
<entry>Requerido</entry>
|
|
<entry>Default</entry>
|
|
<entry>Descripción</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>prefix</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>Date_</entry>
|
|
<entry>Con el prefijo el nombre de la variable</entry>
|
|
</row>
|
|
<row>
|
|
<entry>time</entry>
|
|
<entry>timestamp/YYYY-MM-DD</entry>
|
|
<entry>No</entry>
|
|
<entry>Tiempo actual en el timestamp de unix o el
|
|
formato YYYY-MM-DD</entry>
|
|
<entry>Cual date/time a usar</entry>
|
|
</row>
|
|
<row>
|
|
<entry>start_year</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>Año actual</entry>
|
|
<entry> El primer año primero en el menu dropdown, o
|
|
el número de año, o el relativo al año actual (+/- N)
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>end_year</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>de la misma forma que start_year</entry>
|
|
<entry>El ultimo año en el menu dropdown, o el
|
|
número de año, o el relativo al año actual (+/- N)
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>display_days</entry>
|
|
<entry>boolean</entry>
|
|
<entry>No</entry>
|
|
<entry>true</entry>
|
|
<entry>Muestra los dias o no</entry>
|
|
</row>
|
|
<row>
|
|
<entry>display_months</entry>
|
|
<entry>boolean</entry>
|
|
<entry>No</entry>
|
|
<entry>true</entry>
|
|
<entry>Muestra los meses o no</entry>
|
|
</row>
|
|
<row>
|
|
<entry>display_years</entry>
|
|
<entry>boolean</entry>
|
|
<entry>No</entry>
|
|
<entry>true</entry>
|
|
<entry>Muestra los años o no</entry>
|
|
</row>
|
|
<row>
|
|
<entry>month_format</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>%B</entry>
|
|
<entry>Cual debe ser el formato de salida del mes
|
|
dentro de (strftime)</entry>
|
|
</row>
|
|
<row>
|
|
<entry>day_format</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>%02d</entry>
|
|
<entry>Cual debe ser el formato de salida del dia dentro de (sprintf)</entry>
|
|
</row>
|
|
<row>
|
|
<entry>day_value_format</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>%d</entry>
|
|
<entry>Cual debe ser el formato de salida del valor
|
|
del dia dentro de (sprintf)</entry>
|
|
</row>
|
|
<row>
|
|
<entry>year_as_text</entry>
|
|
<entry>boolean</entry>
|
|
<entry>No</entry>
|
|
<entry>false</entry>
|
|
<entry>Se mostrara o no el año como texto</entry>
|
|
</row>
|
|
<row>
|
|
<entry>reverse_years</entry>
|
|
<entry>boolean</entry>
|
|
<entry>No</entry>
|
|
<entry>false</entry>
|
|
<entry>Muestra los años en orden inverso</entry>
|
|
</row>
|
|
<row>
|
|
<entry>field_array</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>null</entry>
|
|
<entry>
|
|
si un nombre es dado, las cajas de seleción
|
|
seran exibidas semejantes a los resultados
|
|
que estaran retornando al PHP en la forma.
|
|
name[Day], name[Year], name[Month].
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>day_size</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>null</entry>
|
|
<entry>adiciona el tamaño al atributo para la
|
|
etiqueta select si fue dada</entry>
|
|
</row>
|
|
<row>
|
|
<entry>month_size</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>null</entry>
|
|
<entry>adiciona el tamaño del atributo para la
|
|
etiqueta select si fue dada</entry>
|
|
</row>
|
|
<row>
|
|
<entry>year_size</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>null</entry>
|
|
<entry>adiciona el tamaño del atributo para la
|
|
etiqueta select si fue dada</entry>
|
|
</row>
|
|
<row>
|
|
<entry>all_extra</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>null</entry>
|
|
<entry>adiciona atributos extras para todas las
|
|
etiquetas select/input si fueron dadas</entry>
|
|
</row>
|
|
<row>
|
|
<entry>day_extra</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>null</entry>
|
|
<entry>adiciona atributos extras para todas las
|
|
etiquetas select/input si fueron dadas</entry>
|
|
</row>
|
|
<row>
|
|
<entry>month_extra</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>null</entry>
|
|
<entry>adiciona atributos extras para todas las
|
|
etiquetas select/input si fueron dadas</entry>
|
|
</row>
|
|
<row>
|
|
<entry>year_extra</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>null</entry>
|
|
<entry>adiciona atributos extras para todas las
|
|
etiquetas select/input si fueron dadas</entry>
|
|
</row>
|
|
<row>
|
|
<entry>field_order</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>MDY</entry>
|
|
<entry>El orden para ser mostrados los campos</entry>
|
|
</row>
|
|
<row>
|
|
<entry>field_separator</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>\n</entry>
|
|
<entry>Cadena a mostrar entre los diferentes campos</entry>
|
|
</row>
|
|
<row>
|
|
<entry>month_value_format</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>%m</entry>
|
|
<entry> formato strftime de los valores del mes,
|
|
el default es %m para el número del mes.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>year_empty</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>null</entry>
|
|
<entry>Si es proporcionado entonces el primer elemento
|
|
es el año select-box tiene este valor como etiqueta y
|
|
"" como valor.
|
|
Esto es util para hacer una lectura en el select-box
|
|
por ejemplo "por favor seccione el año".
|
|
Note que este puede usar valores como "-MM-DD" como
|
|
atributos de time indicando que el año sea desmarcado.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>month_empty</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>null</entry>
|
|
<entry>Si es proporcinado entonces el mes es el primer
|
|
elemento select-box tiene este valor como etiqueta y
|
|
"" como valor.
|
|
Note que usted puede usar valores como "YYYY--DD" como
|
|
atributos de time indicando que el mes sea desmarcado.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>day_empty</entry>
|
|
<entry>string</entry>
|
|
<entry>No</entry>
|
|
<entry>null</entry>
|
|
<entry>Si es proporcinado entonces es dias es el
|
|
primer elemento select-box tiene este valor como
|
|
etiqueta y "" como valor.
|
|
Note que usted puede usar valores como "YYYY-MM--"
|
|
como atributos de time indicando que el dia sea
|
|
desmarcado.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
<para>
|
|
{html_select_date} es una
|
|
<link linkend="language.custom.functions">función customizada</link>
|
|
que crea menus dropdowns de fechas para usted. Este puede mostrar
|
|
algunos o todos por año, mes y dia.
|
|
</para>
|
|
<example>
|
|
<title>{html_select_date}</title>
|
|
<para>Codigo del Template</para>
|
|
<programlisting>
|
|
<![CDATA[
|
|
{html_select_date}
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Esta es la salida:
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
<select name="Date_Month">
|
|
<option value="1">January</option>
|
|
<option value="2">February</option>
|
|
<option value="3">March</option>
|
|
..... snipped .....
|
|
<option value="10">October</option>
|
|
<option value="11">November</option>
|
|
<option value="12" selected="selected">December</option>
|
|
</select>
|
|
<select name="Date_Day">
|
|
<option value="1">01</option>
|
|
<option value="2">02</option>
|
|
<option value="3">03</option>
|
|
..... snipped .....
|
|
<option value="11">11</option>
|
|
<option value="12">12</option>
|
|
<option value="13" selected="selected">13</option>
|
|
<option value="14">14</option>
|
|
<option value="15">15</option>
|
|
..... snipped .....
|
|
<option value="29">29</option>
|
|
<option value="30">30</option>
|
|
<option value="31">31</option>
|
|
</select>
|
|
<select name="Date_Year">
|
|
<option value="2001" selected="selected">2001</option>
|
|
</select>
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
<example>
|
|
<title>{html_select_date}</title>
|
|
<programlisting>
|
|
<![CDATA[
|
|
{* el año seleccionado puede ser relativo al año actual *}
|
|
{html_select_date prefix="StartDate" time=$time start_year="-5"
|
|
end_year="+1" display_days=false}
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
esta es la salida: (el año actual es 2000)
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
<select name="StartDateMonth">
|
|
<option value="1">January</option>
|
|
<option value="2">February</option>
|
|
<option value="3">March</option>
|
|
<option value="4">April</option>
|
|
<option value="5">May</option>
|
|
<option value="6">June</option>
|
|
<option value="7">July</option>
|
|
<option value="8">August</option>
|
|
<option value="9">September</option>
|
|
<option value="10">October</option>
|
|
<option value="11">November</option>
|
|
<option value="12" selected="selected">December</option>
|
|
</select>
|
|
<select name="StartDateYear">
|
|
<option value="1995">1995</option>
|
|
<option value="1996">1996</option>
|
|
<option value="1997">1997</option>
|
|
<option value="1998">1998</option>
|
|
<option value="1999">1999</option>
|
|
<option value="2000" selected="selected">2000</option>
|
|
<option value="2001">2001</option>
|
|
</select>
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
<para>
|
|
Ver también <link linkend="language.function.html.select.time">{html_select_time}</link>,
|
|
<link linkend="language.modifier.date.format">date_format</link>,
|
|
<link linkend="language.variables.smarty.now">$smarty.now</link>
|
|
y <link linkend="tips.dates">date tips</link>.
|
|
</para>
|
|
</sect1>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|