drupal-eca-recipe / eca_lib_0031
Reads a date value from a node field and demonstrates the tamper actions that reformat it, shift it by a fixed time range and render it in another time zone.
Package info
gitlab.lakedrops.com/drupal/recipes/eca_lib_0031
Type:drupal-recipe
pkg:composer/drupal-eca-recipe/eca_lib_0031
Requires
- drupal/eca: *
- drupal/eca_tamper: *
- drupal/modeler_api: *
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
ID: eca_lib_0031
This model works with a date and time value from a node field and does various things to it: outputting in different formats, adding some time range, changing timezone, etc.
The time zone plugins used by this model ship with the tamper module as of version 1.0.0, so the patch that was once needed is no longer required. Writing a date value back into a date field still needs care with time zones - see Writing date and time values in the correct time zone for the details.
The creation of this module was recorded and the video with additional explanations can be watched here.
Installation
## Import recipe
composer require drupal-eca-recipe/eca_lib_0031
# Apply recipe with Drush (requires version 13 or later):
drush recipe ../recipes/eca_lib_0031
# Apply recipe without Drush:
cd web && php core/scripts/drupal recipe ../recipes/eca_lib_0031
# Rebuilding caches is optional, sometimes required:
drush cr