Drupal is a registered trademark of Dries Buytaert
drupal 11.4.2 Update released for Drupal core (11.4.2)! drupal 11.4.1 Update released for Drupal core (11.4.1)! drupal 11.4.0 Update released for Drupal core (11.4.0)! drupal 10.6.12 Update released for Drupal core (10.6.12)! drupal 11.3.13 Update released for Drupal core (11.3.13)! drupal 10.6.11 Update released for Drupal core (10.6.11)! drupal 11.3.12 Update released for Drupal core (11.3.12)! drupal 11.2.14 Update released for Drupal core (11.2.14)! drupal 10.5.12 Update released for Drupal core (10.5.12)! cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)!
Habeuk DateTime

Provides a custom field formatter for datetime fields with relative time display ("1 month ago", etc.) and SVG icons.

Features

  • Custom field formatter for datetime, timestamp, created and changed fields
  • Displays creation and/or modification dates with calendar and edit icons
  • Relative time display (e.g., "1 month ago", "2 days ago")
  • Configurable settings per field instance
  • Responsive Bootstrap 5 markup

Requirements

  • Drupal 10 or 11
  • PHP 8.1+

Installation

Install as you would normally install a contributed Drupal module.

Composer

composer require drupal/habeuk_datetime

Manual

  1. Download the module and place it in the modules/custom/ directory
  2. Enable the module: drush en habeuk_datetime

Usage

  1. Go to Manage display of your content type (or other entity)
  2. For any datetime, timestamp, created or changed field, select Habeuk Datetime Metadata as the format
  3. Click the settings icon to configure:
    • Show creation date: Display the date the entity was created
    • Show modification date: Display the date the entity was last modified
    • Show relative time: Display relative time (e.g., "1 month ago")

Configuration

Each field instance can be configured independently with these options:

Setting Description Default Show creation date Display the creation date with calendar icon Yes Show modification date Display the modification date with edit icon Yes Show relative time Display "X time ago" next to the date Yes

Template

The module provides a theme hook habeuk_datetime_formatter that can be overridden in your theme:

templates/habeuk-datetime-formatter.html.twig

Variables

Variable Type Description entity Object The entity being displayed show_create_date Boolean Whether to show creation date show_update_date Boolean Whether to show modification date show_date_ago Boolean Whether to show relative time created_formatted String Formatted creation date created_relative String Relative creation time changed_formatted String Formatted modification date changed_relative String Relative modification time

Activity

Total releases
1
First release
Jul 2026
Latest release
14 hours ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
1.0.0 Stable Jul 12, 2026