Calendar"

From Documentation
m
Line 6: Line 6:
 
*Java API: <javadoc>org.zkoss.zul.Calendar</javadoc>
 
*Java API: <javadoc>org.zkoss.zul.Calendar</javadoc>
 
*JavaScript API: <javadoc directory="jsdoc">zul.db.Calendar</javadoc>
 
*JavaScript API: <javadoc directory="jsdoc">zul.db.Calendar</javadoc>
*Style Guide: [http://books.zkoss.org/wiki/ZK_Style_Guide/XUL_Component_Specification/Calendar Calendar]
+
*Style Guide: [[ZK_Style_Guide/XUL_Component_Specification/Calendar| Calendar]]
  
 
= Employment/Purpose =
 
= Employment/Purpose =
Line 13: Line 13:
 
The first day of the week is decided by the locale (actually the return value of the <tt>getFirstDayOfWeek</tt> method in the <tt>java.util.Calendar</tt>).
 
The first day of the week is decided by the locale (actually the return value of the <tt>getFirstDayOfWeek</tt> method in the <tt>java.util.Calendar</tt>).
  
Since 5.0.3, you can control the first day of the week by use of the session attribute and the library property. Please refer to [http://books.zkoss.org/wiki/ZK_Developer%27s_Reference/Internationalization/The_First_Day_of_the_Week The First Day of the Week] for details.
+
Since 5.0.3, you can control the first day of the week by use of the session attribute and the library property. Please refer to [[ZK_Developer%27s_Reference/Internationalization/The_First_Day_of_the_Week|The First Day of the Week]] for details.
  
 
= Customization =
 
= Customization =
Line 84: Line 84:
 
| 5.0.3
 
| 5.0.3
 
| July, 2010
 
| July, 2010
| An application can control the first day of the week by use of the session attribute and the library property. Please refer to [http://books.zkoss.org/wiki/ZK_Developer%27s_Reference/Internationalization/The_First_Day_of_the_Week The First Day of the Week] for details.
+
| An application can control the first day of the week by use of the session attribute and the library property. Please refer to [[ZK_Developer%27s_Reference/Internationalization/The_First_Day_of_the_Week|The First Day of the Week]] for details.
 
|-
 
|-
 
| 5.0.4
 
| 5.0.4

Revision as of 08:03, 19 January 2011

Calendar

Employment/Purpose

A calendar displays a 'flat' calendar and allows user to select a day from it.

The first day of the week is decided by the locale (actually the return value of the getFirstDayOfWeek method in the java.util.Calendar).

Since 5.0.3, you can control the first day of the week by use of the session attribute and the library property. Please refer to The First Day of the Week for details.

Customization

Since 5.0.3, the rendering of the calendar can be customized at the client by providing JavaScript code that overrides Renderer.

Example

ZKComRef Calendar Example.png

 <hlayout>
     <calendar id="cal" onChange="in.value = cal.value"/>
     <datebox id="in" onChange="cal.value = in.value"/>
 </hlayout>

Calendar Day Renderer

This is achieved by overriding the default renderer at the client to customize the appearance of days on ZK's Calendar. For example,

ZKComRef Calendar Example2.png

<zk>
	<script><![CDATA[
		zk.afterLoad('zul.db', function(){
			zul.db.Renderer.cellHTML = function (cal, y, m, day, monthofs) {
				return '<a href="javascript:;" style="color:red;">' + day + '</a>';
			};
		});
	]]></script>
	<calendar/>
</zk>
[Since 5.0.3]

Supported Events

Name
Event Type
None None

Supported Children

*NONE

Use Cases

Version Description Example Location
     

Version History

Last Update : 2011/01/19


Version Date Content
5.0.3 June, 2010 Calendar Day Renderer
5.0.3 July, 2010 An application can control the first day of the week by use of the session attribute and the library property. Please refer to The First Day of the Week for details.
5.0.4 August, 2010 Calendar supports moving to next/prev mon by mouse scrolling.



Last Update : 2011/01/19

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