Smarty Manual
Prev | Chapter 8. Custom Functions | Next

# html_select_time

Attribute Name | Type | Required | Default | Description
--- | --- | --- | --- | ---
prefix | string | No | Time_ | what to prefix the var name with
time | timestamp | No | current time | what date/time to use
display_hours | boolean | No | true | whether or not to display hours
display_minutes | boolean | No | true | whether or not to display minutes
display_seconds | boolean | No | true | whether or not to display seconds
display_meridian | boolean | No | true | whether or not to display meridian (am/pm)
use_24_hours | boolean | No | true | whether or not to use 24 hour clock
minute_interval | integer | No | 1 | number interval in minute dropdown
second_interval | integer | No | 1 | number interval in second dropdown
field_array | string | No | n/a | outputs values to array of this name
all_extra | string | No | null | adds extra attributes to select/input tags if given
hour_extra | string | No | null | adds extra attributes to select/input tags if given
minute_extra | string | No | null | adds extra attributes to select/input tags if given
second_extra | string | No | null | adds extra attributes to select/input tags if given
meridian_extra | string | No | null | adds extra attributes to select/input tags if given

html_select_time is a custom function that creates time dropdowns for you. It can display any or all of hour, minute, second and meridian.

The time-attribute can have different formats. It can be a uniq-timestamp or a string containing Y-M-D. YYYY-MM-DD may be the most common, but months and days with less than two digits are also recognized. If one of the 3 values (Y,M,D) is the empty string, than the according select-box is not pre-selected at all. This is especially useful with the empty_year-, -month- and -day-attritbutes.

Example 8-12. html_select_time
    {html_select_time use_24_hours=true}
This will output:
    <select name="Time_Hour">
    <option value="00">00</option>
    <option value="01">01</option>
    <option value="02">02</option>
    <option value="03">03</option>
    <option value="04">04</option>
    <option value="05">05</option>
    <option value="06">06</option>
    <option value="07">07</option>
    <option value="08">08</option>
    <option value="09" selected>09</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    </select>
    <select name="Time_Minute">
    <option value="00">00</option>
    <option value="01">01</option>
    <option value="02">02</option>
    <option value="03">03</option>
    <option value="04">04</option>
    <option value="05">05</option>
    <option value="06">06</option>
    <option value="07">07</option>
    <option value="08">08</option>
    <option value="09">09</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20" selected>20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>
    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
    <option value="32">32</option>
    <option value="33">33</option>
    <option value="34">34</option>
    <option value="35">35</option>
    <option value="36">36</option>
    <option value="37">37</option>
    <option value="38">38</option>
    <option value="39">39</option>
    <option value="40">40</option>
    <option value="41">41</option>
    <option value="42">42</option>
    <option value="43">43</option>
    <option value="44">44</option>
    <option value="45">45</option>
    <option value="46">46</option>
    <option value="47">47</option>
    <option value="48">48</option>
    <option value="49">49</option>
    <option value="50">50</option>
    <option value="51">51</option>
    <option value="52">52</option>
    <option value="53">53</option>
    <option value="54">54</option>
    <option value="55">55</option>
    <option value="56">56</option>
    <option value="57">57</option>
    <option value="58">58</option>
    <option value="59">59</option>
    </select>
    <select name="Time_Second">
    <option value="00">00</option>
    <option value="01">01</option>
    <option value="02">02</option>
    <option value="03">03</option>
    <option value="04">04</option>
    <option value="05">05</option>
    <option value="06">06</option>
    <option value="07">07</option>
    <option value="08">08</option>
    <option value="09">09</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23" selected>23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>
    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
    <option value="32">32</option>
    <option value="33">33</option>
    <option value="34">34</option>
    <option value="35">35</option>
    <option value="36">36</option>
    <option value="37">37</option>
    <option value="38">38</option>
    <option value="39">39</option>
    <option value="40">40</option>
    <option value="41">41</option>
    <option value="42">42</option>
    <option value="43">43</option>
    <option value="44">44</option>
    <option value="45">45</option>
    <option value="46">46</option>
    <option value="47">47</option>
    <option value="48">48</option>
    <option value="49">49</option>
    <option value="50">50</option>
    <option value="51">51</option>
    <option value="52">52</option>
    <option value="53">53</option>
    <option value="54">54</option>
    <option value="55">55</option>
    <option value="56">56</option>
    <option value="57">57</option>
    <option value="58">58</option>
    <option value="59">59</option>
    </select>
    <select name="Time_Meridian">
    <option value="am" selected>AM</option>
    <option value="pm">PM</option>
    </select>

Prev | Home | Next
html_select_date | Up | html_table