This project is not covered by Drupal’s security advisory policy.
The mobile-friendly, responsive, and lightweight jQuery date & time input picker.
This module provides integration for Pickadate.js library in Drupal 7 to enhance date field collection beyond the standard picker for entity forms or custom Form API forms by providing a widget type and FormAPI element.
How to Use
First, you will need to download the Pickadate.js library. At the time of this writing, version 3.3.0 is supported. You will also need jQuery Update for jQuery version 1.8 or 1.7.
Place the pickadate folder into your libraries folder at libraries/pickadate.
Pickadate.js on GitHub: https://github.com/amsul/pickadate.js
FormAPI Element and Overriding Settings
To add Pickadate to your form or alter how an existing field acts:
In your Form API code or a hook_form_alter, set a field type to 'pickadate_date' or 'pickadate_time'. After that, give it a title, and most importantly, add a #settings key and call pickadate_date_default_settings() or pickadate_time_default_settings() appropriately.
This function populates the form element with default settings for the JS plugin. You can pass in an array to these functions to override the defaults to your liking.
Examples
$form['foo'] = array(
'#type' => 'pickadate_date',
'#title' => t('Date'),
'#settings' => pickadate_date_default_settings(),
);
$form['bar'] = array(
'#type' => 'pickadate_time',
'#title' => t('Time'),
'#settings' => pickadate_time_default_settings(),
);
$form['foo'] = array(
'#type' => 'pickadate_date',
'#title' => t('Date'),
'#settings' => pickadate_date_default_settings(array('selectMonths' => TRUE, 'disable' => array(1,3,5), 'format' => 'mmmm d, yyyy'),
);
$form['bar'] = array(
'#type' => 'pickadate_time',
'#title' => t('Time'),
'#settings' => pickadate_time_default_settings('interval' => 60),
);
Project information
- Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed. - Maintenance fixes only
Considered feature-complete by its maintainers. - Module categories: Administration Tools, Content Editing Experience, Developer Tools
- 64 sites report using this module
- Created by kevinquillen on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Development version: 7.x-1.x-dev updated 6 Jul 2016 at 20:22 UTC