2017 © Pedro Peláez
 

library date-input

HTML 5 compatible date / time input field for Nette.

image

voda/date-input

HTML 5 compatible date / time input field for Nette.

  • Sunday, June 12, 2016
  • by voda
  • Repository
  • 3 Watchers
  • 10 Stars
  • 10,989 Installations
  • JavaScript
  • 1 Dependents
  • 0 Suggesters
  • 9 Forks
  • 7 Open issues
  • 11 Versions
  • 7 % Grown

The README.md

DateInput

Nette forms component for selecting date and time values., (*1)

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., (*2)

Build Status Latest Stable Version Total Downloads License, (*3)

JS dependencies

Installation

$ composer require voda/date-input, (*4)

package can be also installed using bower: $ bower install voda-date-input --save, (*5)

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

<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:, (*7)

Vodacek\Forms\Controls\DateInput::register();

initialize the calendar using javascript:, (*8)

$(document).ready(function() {
    $('input[data-dateinput-type]').dateinput({
        '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"
        }
    });
});

Usage

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

The Versions

12/06 2016

dev-master

9999999-dev

HTML 5 compatible date / time input field for Nette.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Ondřej Vodáček

form calendar date input nette

12/06 2016

1.1.0

1.1.0.0

HTML 5 compatible date / time input field for Nette.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Ondřej Vodáček

form calendar date input nette

14/06 2015

1.0.8

1.0.8.0

HTML 5 compatible date / time input field for Nette.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Ondřej Vodáček

form calendar date input nette

14/02 2015

1.0.7

1.0.7.0

HTML 5 compatible date / time input field for Nette.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Ondřej Vodáček

form calendar date input nette

23/06 2014

1.0.6

1.0.6.0

HTML 5 compatible date / time input field for Nette.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Ondřej Vodáček

form calendar date input nette

15/03 2014

1.0.5

1.0.5.0

HTML 5 compatible date / time input field for Nette.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Ondřej Vodáček

form calendar date input nette

15/03 2014

1.0.4

1.0.4.0

HTML 5 compatible date / time input field for Nette.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Ondřej Vodáček

form calendar date input nette

19/12 2013

1.0.3

1.0.3.0

HTML 5 compatible date / time input field for Nette.

  Sources   Download

BSD-3-Clause

The Requires

 

by Ondřej Vodáček

form calendar date input nette

24/09 2013

1.0.2

1.0.2.0

HTML 5 compatible date / time input field for Nette.

  Sources   Download

BSD-3-Clause

The Requires

 

by Ondřej Vodáček

form calendar date input nette

26/04 2013

1.0.1

1.0.1.0

HTML 5 compatible date / time input field for Nette.

  Sources   Download

BSD-3-Clause

The Requires

 

by Ondřej Vodáček

form calendar date input nette

25/01 2013

1.0.0

1.0.0.0

HTML 5 compatible date / time input field for Nette.

  Sources   Download

BSD-3-Clause

The Requires

 

by Ondřej Vodáček

form calendar date input nette