- Get started
- Set locale
- Set format
- Set icon
- Set disabled dates
- Set min date
- Set max date
- Link two pickers
- Client events
- Options
DateTimePicker
Get started #
DateTimePicker
helps you to pick a single date and time.
<?php
DateTimePicker::create(array(
"name"=>"dueDate",
))
?>
Set locale #
<?php
DateTimePicker::create(array(
"name"=>"dueDate",
"locale"=>"it", //Italy
))
?>
Set format #
Please refer to format
settings of DateRangePicker
.
<?php
DateTimePicker::create(array(
"name"=>"dueDate",
"format"=>"MM/DD/YYYY", //Italy
))
?>
Set icon #
By default, DateTimePicker
use the calendar icon on the right.To disable icon, you do:
<?php
DateTimePicker::create(array(
"name"=>"dueDate",
"icon"=>false
))
?>
If you want to change to another icon, you do:
<?php
DateTimePicker::create(array(
"name"=>"dueDate",
"icon"=>"glyphicon glyphicon-time"
))
?>
Set disabled dates #
Sometime you will need to prevent selection on some special date
<?php
DateTimePicker::create(array(
"name"=>"dueDate",
"disabledDates'=>array(
"2017-12-12"
)
))
?>
Set min date #
The DateTimePicker
will disable selection on those days before the min set date.
<?php
DateTimePicker::create(array(
"name"=>"dueDate",
"minDate"=>"2017-06-28"
))
?>
Set max date #
The DateTimePicker
will not allow user to pick those dates after set max date.
<?php
DateTimePicker::create(array(
"name"=>"dueDate",
"maxDate"=>"2017-06-28"
))
?>
Link two pickers #
Many times, you need to get selection [from,to] date range. the fromDate
will allow only dates that before the date set nu to
date.
<?php
DateTimePicker::create(array(
"name"=>"fromDate",
"maxDate"=>"@toDate"
))
?>
DateTimePicker::create(array(
"name"=>"toDate",
"minDate"=>"@fromDate"
))
?>
Client events #
DateTimePicker
supports following events:
name | description |
---|---|
show | Triggered when the picker is shown |
hide | Triggered when the picker is hidden |
showCalendar | Triggered when the calendar(s) are shown |
hideCalendar | Triggered when the calendar(s) are hidden |
apply | Triggered when the apply button is clicked, or when a predefined range is clicked |
cancel | Triggered when the cancel button is clicked |
<?php
DateTimePicker::create(array(
...
"clientEvents"=>array(
"apply"=>"function(e,picker){
console.log(picker);
}",
)
));
?>
Options #
DateTimePicker
still have many options to set, you may view the full list in here. If we need to add some more customization, we can add those to options
.
<?php
DateTimePicker::create(array(
"name"=>"dueDate",
"options"=>array(
"enabledDates'=>array('2017-4-22','2017-4-23','2017-4-25')
)
))
?>
Get started with KoolReport
KoolReport will help you to construct good php data report by gathering your data from multiple sources, transforming them into valuable insights, and finally visualizing them in stunning charts and graphs.