Download the PHP package ipub/form-datetime without Composer
On this page you can find all versions of the php package ipub/form-datetime. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ipub/form-datetime
More information about ipub/form-datetime
Files in ipub/form-datetime
Package form-datetime
Short Description Forms control for adding date, date&time and time fields for Nette Framework
License BSD-3-Clause GPL-2.0 GPL-3.0
Homepage https://github.com/iPublikuj/form-datetime
Informations about the package form-datetime
Form Date, Date&Time and Time control
Forms control for adding date, date&time and time fields for Nette Framework forms
This extension is based on two datetime libraries. For Bootstrap template is used js library from Sebastien Malot and for UIkit template is used their datepicker and timepicker extensions.
Installation
The best way to install ipub/form-datetime is using Composer:
or
After that you have to register extension in config.neon.
In Nette 2.0, registration is done in
app/bootstrap.php
:
And you also need to include static files into your page:
note: You have to upload static files from client-site folder to your project.
Usage
You can pass configuration for each type of form field:
Settings for all types
You can enable additional buttons which can control showed form field:
Settings for Date picker
Just setup how date picker window should display:
Settings for Time picker
Just setup how time picker window should display:
Settings for Date & Time picker
This type of picker combines all settings from previous two types.
Defining date and time formats
You can set for each field its format how value should be displayed in form.
This two methods require JS format, so for two digits day/mont and four digits year write dd/mm/yyyy etc.
Validation
Validation can be done as on usual text input and also this fields support special ranges values.
If you need to define some range for selecting value, you can use filed range rule:
This rule will also create min and max for picker window, so user will be not able to pick date out of defined range.
There are also nex two rules for minimal and maximal value:
Custom templates and rendering
This control come with templating feature, that mean form element of this control is rendered in latte template. There are 3 predefined templates:
- bootstrap.latte if you are using Twitter Bootstrap
- uikit.latte if you are using YooTheme UIKit
- default.latte for custom styling (this template is loaded as default)
But be aware, if you choose different template than UIkit or Bootstrap, JS will be deactivated!
You can also define you own template if you need to fit this control into your layout.
Template can be set in form definition:
or in manual renderer of the form:
and if you want to switch default template to bootstrap or uikit just it write into template setter:
or
All versions of form-datetime with dependencies
nette/application Version ~2.2
nette/di Version ~2.2
nette/forms Version ~2.2
nette/utils Version ~2.2
latte/latte Version ~2.2