Timepicker"

From Documentation
Line 5: Line 5:
 
*Java API: <javadoc>org.zkoss.zul.Timepicker</javadoc>
 
*Java API: <javadoc>org.zkoss.zul.Timepicker</javadoc>
 
*JavaScript API: <javadoc directory="jsdoc">zkmax.inp.Timepicker</javadoc>
 
*JavaScript API: <javadoc directory="jsdoc">zkmax.inp.Timepicker</javadoc>
*Style Guide: [[ZK_Style_Guide/XUL_Component_Specification/Timepicker | Timepicker]]
+
*Style Guide: [[ZK_Style_Customization_Guide | Timepicker]]
  
 
= Employment/Purpose =
 
= Employment/Purpose =

Revision as of 08:14, 13 May 2015

Timepicker

Employment/Purpose

An edit box for holding a time (a java.util.Date Object) , but only Hour & Minute are used.

Example

ZKCompRef Timebox.png


 <window title="Simple" width="300px" border="normal">
     <timebox id="tb0"/>
 </window>


Properties

Constraint

You could specify what value to accept for input controls by use of the constraint property. It could be no empty.

If you prefer to display different message to the default one, you can append the error message to the constraint with a colon.

<timebox constraint="no empty: cannot be empty"/>

Notes:

  • The error message, if specified, must be the last element and start with colon.
  • To support multiple languages, you could use the 「l」 function as depicted in the Internationalization chapter.
<timebox constraint="no empty: ${c:l('err.time.required')}"/>

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">
		<timebox cols="20" format="a hh:mm:ss"/>
	</window>
</zk>

In addition to specifying the format explicitly, you could specify the styling[1]. There are four different types of styling: short, medium, long and full (representing the styling of java.text.DateFormat). For example, you could specify the styling rather than the real format as follows.

<timebox format="short"/>
<timebox format="long"/>

Then the real format of the timebox will be decided at run time depending the configuration. For more information, please refer to ZK Developer's Reference: Date and Time Formatting.


  1. The styling is available since 5.0.7

Locale

By default, the real format depends on the current locale (i.e., Locales.getCurrent(). However, you could specify the locale for an individual instance such as:

<timebox format="medium" locale="de_DE"/>
<timebox format="long" locale="fr"/>

Inherited Functions

Please refer to FormatInputElement for inherited functions.

Supported Events

Name
Event Type
None None

Supported Molds

Available molds of a component are defined in lang.xml embedded in zul.jar.

Name
Snapshot
default
Timebox mold default.png
rounded
Timebox mold rounded.png
[Since 5.0.0]

Supported Children

*NONE

Use Cases

Version Description Example Location
     

Version History

Last Update : 2015/05/13


Version Date Content
5.0.7 April, 2011 Timebox.setFormat(String) supported the styling.
5.0.7 April, 2011 Timebox.setLocale(Locale) was introduced to specify a locale other than the current locale.



Last Update : 2015/05/13

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.