Timepicker"
Line 24: | Line 24: | ||
=Properties= | =Properties= | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Format == | == Format == | ||
Line 52: | Line 34: | ||
<zk> | <zk> | ||
<window title="Test"> | <window title="Test"> | ||
− | < | + | <timepicker format="a hh:mm:ss"/> |
</window> | </window> | ||
</zk></source> | </zk></source> | ||
− | In addition to specifying the format explicitly, you could specify the styling<ref>The styling is available since 5.0.7</ref>. There are | + | In addition to specifying the format explicitly, you could specify the styling<ref>The styling is available since 5.0.7</ref>. There are two different types of styling: short, medium (representing the styling of java.text.DateFormat). For example, you could specify the styling rather than the real format as follows. |
<source lang="xml"> | <source lang="xml"> | ||
− | < | + | <timepicker format="short"/> |
− | < | + | <timepicker format="medium"/> |
</source> | </source> | ||
− | Then the real format of the | + | Then the real format of the timepicker will be decided at run time depending the configuration. For more information, please refer to [[ZK Developer's Reference/Internationalization/Date and Time Formatting|ZK Developer's Reference: Date and Time Formatting]]. |
<blockquote> | <blockquote> | ||
Line 70: | Line 52: | ||
</blockquote> | </blockquote> | ||
− | == | + | == min == |
− | By default, the | + | By default, the options of timepicker start at 0:00 AM, you could specify another minimum time by using a java.util.Date Object. |
+ | |||
+ | <source lang="xml"> | ||
+ | <zscript> | ||
+ | import java.util.Date; | ||
+ | Date min = new Date(); | ||
+ | min.setTime(0); | ||
+ | </zscript> | ||
+ | <timepicker format="HH:mm a" min="${min}" /> | ||
+ | </source> | ||
+ | |||
+ | == max == | ||
+ | By default, the options of timepicker end before 12:00 AM, you could specify another maximum time by using a java.util.Date Object. | ||
+ | |||
+ | <source lang="xml"> | ||
+ | <zscript> | ||
+ | import java.util.Date; | ||
+ | Date max = new Date(); | ||
+ | max.setTime(0); | ||
+ | </zscript> | ||
+ | <timepicker format="HH:mm a" max="${min}" /> | ||
+ | </source> | ||
+ | |||
+ | == interval == | ||
+ | By default, the interval of the options in timepicker is one hour, you could specify the interval by using an integer (unit: 1 second). | ||
<source lang="xml"> | <source lang="xml"> | ||
− | < | + | <timepicker format="HH:mm a" interval="600" /> |
− | |||
</source> | </source> | ||
Revision as of 08:44, 13 May 2015
Timepicker
- Java API: Timepicker
- JavaScript API: Timepicker
- Style Guide: Timepicker
Employment/Purpose
A selection box for holding a time (a java.util.Date Object) , but only Hour, Minute, and Second are used.
Example
<window title="Simple" width="300px" border="normal">
<timebox id="tb0"/>
</window>
Properties
Format
Use a to signify it is am or pm. The input string follows the formatting of the SimpleDateFormat.
Below is an example of using a within the format.
<zk>
<window title="Test">
<timepicker format="a hh:mm:ss"/>
</window>
</zk>
In addition to specifying the format explicitly, you could specify the styling[1]. There are two different types of styling: short, medium (representing the styling of java.text.DateFormat). For example, you could specify the styling rather than the real format as follows.
<timepicker format="short"/>
<timepicker format="medium"/>
Then the real format of the timepicker will be decided at run time depending the configuration. For more information, please refer to ZK Developer's Reference: Date and Time Formatting.
- ↑ The styling is available since 5.0.7
min
By default, the options of timepicker start at 0:00 AM, you could specify another minimum time by using a java.util.Date Object.
<zscript>
import java.util.Date;
Date min = new Date();
min.setTime(0);
</zscript>
<timepicker format="HH:mm a" min="${min}" />
max
By default, the options of timepicker end before 12:00 AM, you could specify another maximum time by using a java.util.Date Object.
<zscript>
import java.util.Date;
Date max = new Date();
max.setTime(0);
</zscript>
<timepicker format="HH:mm a" max="${min}" />
interval
By default, the interval of the options in timepicker is one hour, you could specify the interval by using an integer (unit: 1 second).
<timepicker format="HH:mm a" interval="600" />
Inherited Functions
Please refer to FormatInputElement for inherited functions.
Supported Events
None | None |
- Inherited Supported Events: FormatInputElement
Supported Molds
Available molds of a component are defined in lang.xml embedded in zul.jar.
[Since 5.0.0] |
Supported Children
*NONE
Use Cases
Version | Description | Example Location |
---|---|---|
Version History
Version | Date | Content |
---|---|---|