\Kendo\UI\Calendar

A PHP wrapper for Kendo UI Calendar.

Inherits from \Kendo\UI\Widget.

Usage

To use Calendar 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 Calendar

<?php
// Create a new instance of Calendar and specify its id
$calendar = new \Kendo\UI\Calendar('Calendar');

// Configure it
$calendar->allowReverse(true)

// Output it

echo $calendar->render();
?>

Methods

allowReverse

Enables the user to select an end date that is before the start date. This option is available only when the selectable configuration is set to range.

Returns

\Kendo\UI\Calendar

Parameters

$value boolean

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->allowReverse(true);
?>

centuryCellsFormat

Specifies the format of the century cells. "long" - The cells will display a decade range 2000-2009, 2010-2019. or "short" - The cells will display just the starting year of the decade 2000, 2010..

Returns

\Kendo\UI\Calendar

Parameters

$value string

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->centuryCellsFormat('value');
?>

change

Fires when the selected date is changed. For additional information check the change event documentation.

Returns

\Kendo\UI\Calendar

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->change('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onChange(e) {
        // handle the change event.
    }
</script>
<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->change('onChange');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->change(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\Calendar

Parameters

$value string

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->componentType('value');
?>

culture

Specifies the culture info used by the widget.

Returns

\Kendo\UI\Calendar

Parameters

$value string

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->culture('value');
?>

dates

Specifies a list of dates, which will be passed to the month template.

Returns

\Kendo\UI\Calendar

Parameters

$value array

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->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\Calendar

Parameters

$value string

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->depth('value');
?>

The template which renders the footer. If false, the footer will not be rendered.

Returns

\Kendo\UI\Calendar

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->footer('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->footer(new \Kendo\JavaScriptFunction('function() { }'));
?>

format

Specifies the format, which is used to parse value set with value() method.

Returns

\Kendo\UI\Calendar

Parameters

$value string

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->format('value');
?>

max

Specifies the maximum date, which the calendar can show.

Returns

\Kendo\UI\Calendar

Parameters

$value date

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->max(new date());
?>

messages

Allows localization of the strings that are used in the widget.

Returns

\Kendo\UI\Calendar

Parameters

$value \Kendo\UI\CalendarMessages|array

Example - using \Kendo\UI\CalendarMessages

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$messages = new \Kendo\UI\CalendarMessages();
$navigateTo = 'value';
$messages->navigateTo($navigateTo);
$calendar->messages($messages);
?>

Example - using array

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$navigateTo = 'value';
$calendar->messages(array('navigateTo' => $navigateTo));
?>

min

Specifies the minimum date, which the calendar can show.

Returns

\Kendo\UI\Calendar

Parameters

$value date

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->min(new date());
?>

month

Templates for the cells rendered in "month" view.

Returns

\Kendo\UI\Calendar

Parameters

$value \Kendo\UI\CalendarMonth|array

Example - using \Kendo\UI\CalendarMonth

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$month = new \Kendo\UI\CalendarMonth();
$content = 'value';
$month->content($content);
$calendar->month($month);
?>

Example - using array

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$content = 'value';
$calendar->month(array('content' => $content));
?>

Fires when calendar navigates. For additional information check the navigate event documentation.

Returns

\Kendo\UI\Calendar

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->navigate('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onNavigate(e) {
        // handle the navigate event.
    }
</script>
<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->navigate('onNavigate');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->navigate(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

range

Specifies an initial range selection. This option is available only when the selectable configuration is set to range.

Returns

\Kendo\UI\Calendar

Parameters

$value \Kendo\UI\CalendarRange|array

Example - using \Kendo\UI\CalendarRange

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$range = new \Kendo\UI\CalendarRange();
$end = new date();
$range->end($end);
$calendar->range($range);
?>

Example - using array

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$end = new date();
$calendar->range(array('end' => $end));
?>

selectDates

Specifies which dates to be selected when the calendar is initialized.

Returns

\Kendo\UI\Calendar

Parameters

$value array

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->selectDates(array());
?>

selectable

By default user is able to select a single date. The property can also be set to multiple or range. More information about the different selection modes can be found in the Selection article.

Returns

\Kendo\UI\Calendar

Parameters

$value string

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->selectable('value');
?>

showOtherMonthDays

When this configuration is enabled, the calendar will render days from the previous and next months in the current view.

Returns

\Kendo\UI\Calendar

Parameters

$value boolean

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->showOtherMonthDays(true);
?>

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\Calendar

Parameters

$value string

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->start('value');
?>

value

Specifies the selected date.

Returns

\Kendo\UI\Calendar

Parameters

$value date

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->value(new date());
?>

weekNumber

If set to true a week of the year will be shown on the left side of the calendar.

Returns

\Kendo\UI\Calendar

Parameters

$value boolean

Example

<?php
$calendar = new \Kendo\UI\Calendar('Calendar');
$calendar->weekNumber(true);
?>
In this article
Not finding the help you need?