An component for datapicker.
Datepicker is used for input element which need date type input. When user focus on the element, a datepicker component will popup for user use.
Enable datepick via attr data-toggle="datepicker"
:
<button class="btn" data-toggle="datepicker"> <i class="icon-calendar"></i> </button>
Append the option name to data-
, as in data-type
.
Name | type | default | description |
---|---|---|---|
type | string | all |
all will display date and time selector.
timer will display time selector.
dater will display date selector.
|
to | string | Set the target input element. When user change the date, the value of target input element will also be changed. |
Event | Description |
---|---|
change |
It will trigger when datepicker change its value. When data-ato is setted, change event will trigger with target element.
|
$("#element").change(function(){ alert("Date Change!"); });