ch.DatePicker (Class)

Documentation updated on Mon Mar 12 2012 17:48:10 GMT-0300 (GMT-03:00), generated by JsDoc Toolkit 2.4.0

Overview

Is a UI Widget for picking dates.

Summary

Visibility Name Description
<protected>  
Reference to the Calendar component instance.
<public>  
Reference to a DOM Element.
<protected>  
Reference to the Float component instanced.
<private>  
Reference to a internal component instance, saves all the information and configuration properties.
<public>  
This public property defines the component type.
<public>  
uid
The 'uid' is the Chico's unique instance identifier.

Fields borrowed from class ch.Controls: createFloat

Fields borrowed from class ch.Uiobject: DOMParent,originalContent,position,staticContent

Visibility Name Description
<public>  
from()
Set a minimum selectable date.
<public>  
hide()
Triggers the innerHide method and returns the public scope to keep method chaining.
<public>  
next(time)
Move to the next month or year.
<protected>  
Pick a date in the Calendar and updates the input data.
<public>  
Reset the Date Picker to date of today
<public>  
Select a specific date or returns the selected date.
<public>  
show()
Triggers the innerShow method and returns the public scope to keep method chaining.
<public>  
to()
Set a maximum selectable date.
<public>  
Returns date of today

Methods borrowed from class ch.Uiobject: content, prevent

Methods borrowed from class ch.Object: callbacks, off, on, once, trigger

Visibility Name Description
<public>  
Triggers when the component is ready to use (Since 0.8.0).

Classdetail

Parameters

  • conf: Object, Optional. Object with configuration properties.
  • conf.format: String, Optional. Sets the date format. By default is "DD/MM/YYYY".
  • conf.selected: String, Optional. Sets a date that should be selected by default. By default is the date of today.
  • conf.from: String, Optional. Set a maximum selectable date.
  • conf.to: String, Optional. Set a minimum selectable date.
  • conf.points: String, Optional. Points to be positioned. See Positioner component. By default is "ct cb".
  • conf.monthsNames: Array, Optional. By default is ["Enero", ... , "Diciembre"].
  • conf.weekdays: Array, Optional. By default is ["Dom", ... , "Sab"].
  • conf.closable: Boolean, Optional. Defines if floated component will be closed when a date is selected or not. By default it's "true".

Returns

  • itself

Requires

Examples

// Create a new Date Picker with configuration.
var me = $(".example").datePicker({
	 "format": "MM/DD/YYYY",
	 "selected": "2011/12/25",
	 "from": "2010/12/25",
	 "to": "2012/12/25",
	 "monthsNames": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
	 "weekdays": ["Su", "Mo", "Tu", "We", "Thu", "Fr", "Sa"]
});
// Create a new datePicker with a class name 'example'.
var me = $(".example").datePicker();

Properties detail

calendar (protected, Object)

Reference to the Calendar component instance.

element (public, HTMLElement)

Reference to a DOM Element. This binding between the component and the HTMLElement, defines context where the component will be executed. Also is usual that this element triggers the component default behavior.

float (protected, Object)

Reference to the Float component instanced.

that (private, object)

Reference to a internal component instance, saves all the information and configuration properties.

type (public, String)

This public property defines the component type. All instances are saved into a 'map', grouped by its type. You can reach for any or all of the components from a specific type with 'ch.instances'.

uid (public, Number)

The 'uid' is the Chico's unique instance identifier. Every instance has a different 'uid' property. You can see its value by reading the 'uid' property on any public instance.

Methods detail

from (public)

Set a minimum selectable date.

Parameters
  • "YYYY/MM/DD".: string.
Returns
  • itself

hide (public)

Triggers the innerHide method and returns the public scope to keep method chaining.

Examples
// Following the first example, using 'me' as modal's instance controller:
me.hide();
Returns
  • itself

next (public, itself)

Move to the next month or year. If it isn't specified, it will be moved to next month.

Parameters
  • time: String. A string that allows specify if it should move to next month or year.
Returns
  • (itself)

process (protected)

Pick a date in the Calendar and updates the input data.

reset (public)

Reset the Date Picker to date of today

Returns
  • itself

select (public)

Select a specific date or returns the selected date.

Parameters
  • "YYYY/MM/DD". (Since : string.
Returns
  • itself

show (public)

Triggers the innerShow method and returns the public scope to keep method chaining.

Examples
// Following the first example, using 'me' as modal's instance controller:
me.show();
Returns
  • itself

to (public)

Set a maximum selectable date.

Parameters
  • "YYYY/MM/DD".: string.
Returns
  • itself

today (public)

Returns date of today

Returns
  • date

Events detail

ready (public)

Triggers when the component is ready to use (Since 0.8.0).

Examples
// Following the first example, using 'me' as Date Picker's instance controller:
me.on("ready", function () {
	this.show();
});