\Kendo\UI\DatePicker
A PHP wrapper for Kendo UI DatePicker.
Inherits from \Kendo\UI\Widget.
Usage
To use DatePicker in a PHP page instantiate a new instance, configure it via the available
configuration methods and output it by echo
-ing the result of the render method.
Using Kendo DatePicker
<?php
// Create a new instance of DatePicker and specify its id
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
// Configure it
$datePicker->adaptiveMode('value')
// Output it
echo $datePicker->render();
?>
Methods
ARIATemplate
Specifies a template used to populate the value of the aria-label attribute of the currently focused cell of the calendar. The parameters available for the template are: current - The current focused date.; valueType - The focused item value type - month, year and etc. or text - A text representing the focused value..
Returns
\Kendo\UI\DatePicker
Parameters
$value string
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->ARIATemplate('value');
?>
adaptiveMode
Specifies the adaptive rendering of the component. The supported values are: none (default), auto.
Returns
\Kendo\UI\DatePicker
Parameters
$value string
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->adaptiveMode('value');
?>
animation
Configures the opening and closing animations of the calendar popup. Setting the animation option to false will disable the opening and closing animations. As a result the calendar popup will open and close instantly. is not a valid configuration.
Returns
\Kendo\UI\DatePicker
Parameters
$value boolean|\Kendo\UI\DatePickerAnimation|array
Example - using boolean
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->animation(true);
?>
Example - using \Kendo\UI\DatePickerAnimation
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$animation = new \Kendo\UI\DatePickerAnimation();
$close = new \Kendo\UI\DatePickerAnimationClose();
$animation->close($close);
$datePicker->animation($animation);
?>
Example - using array
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$close = new \Kendo\UI\DatePickerAnimationClose();
$datePicker->animation(array('close' => $close));
?>
change
Fires when the selected date is changed For additional information check the change event documentation.
Returns
\Kendo\UI\DatePicker
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->change('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onChange(e) {
// handle the change event.
}
</script>
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->change('onChange');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->change(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
close
Fires when the calendar is closed For additional information check the close event documentation.
Returns
\Kendo\UI\DatePicker
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->close('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onClose(e) {
// handle the close event.
}
</script>
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->close('onClose');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->close(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
componentType
Specifies the component type of the widget. "classic" - Uses the standard rendering of the widget. or "modern" - Uses new rendering with a fresh and modern look and feel..
Returns
\Kendo\UI\DatePicker
Parameters
$value string
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->componentType('value');
?>
culture
Specifies the culture info used by the widget.
Returns
\Kendo\UI\DatePicker
Parameters
$value string
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->culture('value');
?>
dateInput
Specifies if the DatePicker will use DateInput for editing value
Returns
\Kendo\UI\DatePicker
Parameters
$value boolean
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->dateInput(true);
?>
dates
Specifies a list of dates, which will be passed to the month content.
Returns
\Kendo\UI\DatePicker
Parameters
$value array
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->dates(array());
?>
depth
Specifies the navigation depth. The following settings are available for the depth value: "month" - Shows the days of the month.; "year" - Shows the months of the year.; "decade" - Shows the years of the decade. or "century" - Shows the decades from the century..
Returns
\Kendo\UI\DatePicker
Parameters
$value string
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->depth('value');
?>
fillMode
Sets a value controlling how the color is applied. Can also be set to the following string values: "none"; "solid"; "flat" or "outline".
Returns
\Kendo\UI\DatePicker
Parameters
$value string
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->fillMode('value');
?>
footer
The template which renders the footer of the calendar. If false, the footer will not be rendered.
Returns
\Kendo\UI\DatePicker
Parameters
$value string|\Kendo\JavaScriptFunction|boolean
Example - using string
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->footer('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->footer(new \Kendo\JavaScriptFunction('function() { }'));
?>
Example - using boolean
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->footer(true);
?>
format
Specifies the format, which is used to format the value of the DatePicker displayed in the input. The format also will be used to parse the input.For more information on date and time formats please refer to Date Formatting.
Returns
\Kendo\UI\DatePicker
Parameters
$value string
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->format('value');
?>
label
Adds a label before the datepicker. If the datepicker has no id attribute, a generated id will be assigned. The string and the function parameters are setting the inner HTML of the label.
Returns
\Kendo\UI\DatePicker
Parameters
$value string|\Kendo\JavaScriptFunction|\Kendo\UI\DatePickerLabel|array
Example - using string
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->label('value');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->label(new \Kendo\JavaScriptFunction('function() { }'));
?>
Example - using \Kendo\UI\DatePickerLabel
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$label = new \Kendo\UI\DatePickerLabel();
$content = 'value';
$label->content($content);
$datePicker->label($label);
?>
Example - using array
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$content = 'value';
$datePicker->label(array('content' => $content));
?>
max
Specifies the maximum date, which the calendar can show.
Returns
\Kendo\UI\DatePicker
Parameters
$value date
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->max(new date());
?>
messages
Allows localization of the strings that are used in the widget.
Returns
\Kendo\UI\DatePicker
Parameters
$value \Kendo\UI\DatePickerMessages|array
Example - using \Kendo\UI\DatePickerMessages
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$messages = new \Kendo\UI\DatePickerMessages();
$weekColumnHeader = 'value';
$messages->weekColumnHeader($weekColumnHeader);
$datePicker->messages($messages);
?>
Example - using array
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$weekColumnHeader = 'value';
$datePicker->messages(array('weekColumnHeader' => $weekColumnHeader));
?>
min
Specifies the minimum date that the calendar can show.
Returns
\Kendo\UI\DatePicker
Parameters
$value date
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->min(new date());
?>
month
Templates for the cells rendered in the calendar "month" view.
Returns
\Kendo\UI\DatePicker
Parameters
$value \Kendo\UI\DatePickerMonth|array
Example - using \Kendo\UI\DatePickerMonth
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$month = new \Kendo\UI\DatePickerMonth();
$content = 'value';
$month->content($content);
$datePicker->month($month);
?>
Example - using array
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$content = 'value';
$datePicker->month(array('content' => $content));
?>
open
Fires when the calendar is opened For additional information check the open event documentation.
Returns
\Kendo\UI\DatePicker
Parameters
$value string|\Kendo\JavaScriptFunction
Example - using string which defines a JavaScript function
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->open('function(e) { }');
?>
Example - using string which defines a JavaScript name
<script>
function onOpen(e) {
// handle the open event.
}
</script>
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->open('onOpen');
?>
Example - using \Kendo\JavaScriptFunction
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->open(new \Kendo\JavaScriptFunction('function(e) { }'));
?>
parseFormats
Specifies a list of date formats used to parse the value set with value() method or by direct user input. If not set the value of the format will be used. Note that the format option is always used during parsing.
Returns
\Kendo\UI\DatePicker
Parameters
$value array
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->parseFormats(array());
?>
popup
The options that will be used for the popup initialization. For more details about the available options refer to Popup documentation.
Returns
\Kendo\UI\DatePicker
Parameters
$value \Kendo\UI\DatePickerPopup|array
Example - using \Kendo\UI\DatePickerPopup
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$popup = new \Kendo\UI\DatePickerPopup();
$appendTo = 'value';
$popup->appendTo($appendTo);
$datePicker->popup($popup);
?>
Example - using array
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$appendTo = 'value';
$datePicker->popup(array('appendTo' => $appendTo));
?>
rounded
Sets a value controlling the border radius. Can also be set to the following string values: "none"; "small"; "medium"; "large" or "full".
Returns
\Kendo\UI\DatePicker
Parameters
$value string
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->rounded('value');
?>
size
Sets a value controlling size of the component. Can also be set to the following string values: "small"; "medium"; "large" or "none".
Returns
\Kendo\UI\DatePicker
Parameters
$value string
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->size('value');
?>
start
Specifies the start view. The following settings are available for the start value: "month" - Shows the days of the month.; "year" - Shows the months of the year.; "decade" - Shows the years of the decade. or "century" - Shows the decades from the century..
Returns
\Kendo\UI\DatePicker
Parameters
$value string
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->start('value');
?>
value
Specifies the selected date.
Returns
\Kendo\UI\DatePicker
Parameters
$value date
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->value(new date());
?>
weekNumber
If set to true a week of the year will be shown on the left side of the calendar. It is possible to define a template in order to customize what will be displayed.
Returns
\Kendo\UI\DatePicker
Parameters
$value boolean
Example
<?php
$datePicker = new \Kendo\UI\DatePicker('DatePicker');
$datePicker->weekNumber(true);
?>