HTML 5 compatible date / time input field for Nette.

2.0.0 2019-08-25 15:35 UTC

This package is auto-updated.

Last update: 2023-05-22 22:06:15 UTC


Nette forms component for selecting date and time values.

In PHP this addon works with DateTime objects, in the browser it uses jqueryUI calendar with timepicker addon. Look at some examples at the demo page.

Build Status Latest Stable Version Total Downloads License

JS dependencies


$ composer require voda/date-input

package can be also installed using bower: $ bower install voda-date-input --save

insert required javascript and style files into your layout (order of scripts is important):

<script type='text/javascript' src="{$basePath}/scripts/jquery-ui-timepicker-addon.js"></script>
<script type='text/javascript' src="{$basePath}/scripts/dateInput.js"></script>
<link rel="stylesheet" type="text/css" href="{$basePath}/styles/jquery-ui-timepicker-addon.css">
<link rel="stylesheet" type="text/css" href="{$basePath}/styles/dateInput.css">

register the addon in your bootstrap.php:


initialize the calendar using javascript:

$(document).ready(function() {
        'datetime-local': {
            dateFormat: 'd.m.yy',
            timeFormat: 'H:mm',
            options: { // options for type=datetime-local
                changeYear: true
        date: {
            dateFormat: 'd.m.yy'
        month: {
            dateFormat: 'MM yy'
        week: {
            dateFormat: "w. 'week of' yy"
        time: {
            timeFormat: 'H:mm'
        options: { // global options
            closeText: "Close"


$form->addDate('datetimeLocal', 'Local datetime', DateInput::TYPE_DATETIME_LOCAL)
        ->setDefaultValue(new DateTimeImmutable())
        ->addRule(Form::RANGE, null, array(new DateTimeImmutable('-2 years'), new DateTimeImmutable('+2 years')));