Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
single_datetime
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
single_datetime
Commits
82b56e9b
Commit
82b56e9b
authored
1 year ago
by
Joao Ventura
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3338229
: Update README.md file according to "README.md template"
parent
459abff8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+49
-71
49 additions, 71 deletions
README.md
with
49 additions
and
71 deletions
README.md
+
49
−
71
View file @
82b56e9b
CONTENTS OF THIS FILE
---------------------
*
Introduction
*
Requirements
*
Installation
*
Configuration
*
Views exposed filters
*
Maintainers
INTRODUCTION
------------
# Single DateTimePicker
The Single Date Time Picker module supports date/time and date fields. You can
use it on Datetime and Datetime Range fields.
Features:
*
Support Datetime and Datetime Range field types
*
Support for Views exposed filters
*
12/24 hour format display
*
Option to choose granularity for minutes
*
Option to disable specific days global (etc. Saturday)
*
Option to disable specific dates, useful for holidays, working days, etc.
-
Support Datetime and Datetime Range field types
-
Support for Views exposed filters
-
12/24 hour format display
-
Option to choose granularity for minutes
-
Option to disable specific days global (etc. Saturday)
-
Option to disable specific dates, useful for holidays, working days, etc.
For a full description of the module, visit the
[
project page
](
https://www.drupal.org/project/single_datetime
)
.
Submit bug reports and feature suggestions, or track changes in the
[
issue queue
](
https://www.drupal.org/project/issues/single_datetime
)
.
*
For a full description of the module visit:
https://www.drupal.org/project/single_datetime
*
To submit bug reports and feature suggestions, or to track changes visit:
https://www.drupal.org/project/issues/single_datetime
## Table of contents
-
Requirements
-
Installation
-
Configuration
-
Views exposed filters
REQUIREMENTS
------------
## Requirements
This module requires the following outside of Drupal core:
*
Plugin Date and Time Picker library
-
https://github.com/xdan/datetimepicker
-
[
Plugin Date and Time Picker library
](
https://github.com/xdan/datetimepicker
)
INSTALLATION
------------
## Installation
*
Install the Single Date Time Picker module as you would normally install a
contributed Drupal module. Visit https://www.drupal.org/node/1897420 for
further information.
*
Install external library from xdan trough composer or manual. Library
should be available at example.com/libraries/jquery-datetimepicker
-
Install as you would normally install a contributed Drupal module. For further
information, see
[Installing Drupal Modules]
(https://www.drupal.org/docs/extending-drupal/installing-drupal-modules).
-
Install external library from xdan trough composer or manual. Library
should be available at example.com/libraries/jquery-datetimepicker
1. Manual download.
Download https://github.com/xdan/datetimepicker/archive/2.5.20.zip,
Download
`
https://github.com/xdan/datetimepicker/archive/2.5.20.zip
`
,
and extract inside [webroot]/libraries/jquery-datetimepicker
2. Using drupal-libraries-installer plugin.
...
...
@@ -87,30 +82,29 @@ INSTALLATION
composer require "npm-asset/jquery-datetimepicker":"^2.5"
```
[Ensure composer packages of type drupal-library (options 2 and 3) or
npm-asset (option 4) are configured to install to the appropriate path.
](https://www.drupal.org/docs/develop/using-composer/using-composer-to-install-drupal-and-manage-dependencies#third-party-libraries)
[
Ensure composer packages of type drupal-library (options 2 and 3) or
npm-asset (option 4) are configured to install to the appropriate path.
](
https://www.drupal.org/docs/develop/using-composeusing-composer-to-install-drupal-and-manage-dependencies#third-party-libraries
)
CONFIGURATION
-------------
## Configuration
1.
Navigate to Administration > Extend and enable the module.
2.
Navigate to Administration > Structure > Content types > [Content type
with date field] > Manage form display.
3.
Select the date field to edit and choose "Single Date Time Picker" from
Widget drop down.
4.
Edit the Field Plugin Setting by selecting the gear icon.
5.
Select the hours format: 12 hours or 24 hours.
6.
Select granularity for minutes in calendar: 5, 10, 15, 30, or 60 minutes.
7.
Select days which are to be disabled in calendar.
8.
To disable specific dates from calendar enter days in following format
d.m.Y etc. 31.12.2018. Each date in new line. This is used for specific
dates.
9.
Update and Save.
1.
Navigate to Administration > Extend and enable the module.
2.
Navigate to Administration > Structure > Content types > [Content type
with date field] > Manage form display.
3.
Select the date field to edit and choose "Single Date Time Picker" from
Widget drop down.
4.
Edit the Field Plugin Setting by selecting the gear icon.
5.
Select the hours format: 12 hours or 24 hours.
6.
Select granularity for minutes in calendar: 5, 10, 15, 30, or 60 minutes.
7.
Select days which are to be disabled in calendar.
8.
To disable specific dates from calendar enter days in following format
d.m.Y etc. 31.12.2018. Each date in new line. This is used for specific
dates.
9.
Update and Save.
VIEWS EXPOSED FILTERS
-------------
## Views exposed filters
This module contains submodule
`single_datetime_exposed`
.
If you enable it, all exposed filters of types
`date`
and
`search_api_date`
will
...
...
@@ -120,8 +114,7 @@ It works with all operators, and none configuration is needed.
If you need customized configuration, suggesting that you create your
implementation based on this submodule.
FORM API USAGE
-------------
**Form api usage**
You can use SingleDateTime in other parts of the Drupal FORM API with minor
adjustments. If you are using non single_datetime elements, as textfield field
type, you need to attach proper attributes on the field, and attach JS library
...
...
@@ -133,8 +126,6 @@ single_datetime directly.
Also exist helper
`\Drupal\single_datetime\AttributeHelper`
with some default
attributes options and examples. See examples below.
**Custom single_datetime field**
Using AttributeHelper you can create default widget:
...
...
@@ -149,7 +140,6 @@ $form['purchase_date'] = [
] + \Drupal\single_datetime\AttributeHelper::allElementAttributes();
```
Directly using your attributes.
```
$form['purchase_date'] = [
...
...
@@ -189,7 +179,6 @@ Using AttributeHelper you can create default widget:
$form['#attributes']['autocomplete'] = 'off';
```
Directly using your attributes.
```
// Using datetimepicker module.
$form['purchase_date'] = [
...
...
@@ -211,14 +200,3 @@ Directly using your attributes.
$form['#attached']['library'][] = 'single_datetime/datetimepicker';
$form['#attributes']['autocomplete'] = 'off';
```
MAINTAINERS
-----------
*
Valentino Međimorec (valic) - https://www.drupal.org/u/valic
Supporting organization:
*
Vallic - https://www.drupal.org/vallic
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment