date_time_picker

Experimental project

This is a sandbox project, which contains experimental code for developer use only.

Date Time Picker allows you to use the datetimepicker plugin (http://xdsoft.net/jqplugins/datetimepicker/) to build a form using the forms API. For example:

$form['date_time_picker'] = array(
  '#type' => 'date_time_picker',
  '#title' => $this->t('Pick a date')
);

This module also provides a widget for the date fields on your entity types. Choose 'Date Time Picker' as the widget on the Manage Form Display and your users will be able to use the plugin on their entity add forms.

Installation:
- Download the jquery library from here: https://github.com/xdan/datetimepicker
- Extract and paste jquery.datetimepicker.css to /libraries/date_time_picker/css and jquery.datetimepicker.full.js to /libraries/date_time_picker/js
- Enable the module.

Future Enhancements:
- Create 2 more form elements: date_only_picker and time_only_picker
- Read the date field setting and render the correct form element for the field widget.

Supporting organizations: 
Sponsored Development

Project information

  • Created by utsavjshah on , updated