Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Taarikh

23 sites Security covered Drupal 10–11
View on drupal.org

Taarikh provides a field formatter and widget for Drupal's date module, allowing users to input and display dates in the Hijri calendar. It also offers developer tools for custom form elements and supports defining custom calendar types.

Taarikh

Taarikh is a field formatter and widget module to display and input hijri dates for the fields defined by the date module. The formatter and the widget works with the date fields provided by Drupal core.

This module also provides element types which you, as a developer, could use in your own forms.

When do I need this module

You need this module for any of the use cases:

  • You need to allow users to enter dates in Hijri or another calendar.
  • You need to display dates in Hijri or another calendar.
  • You need to define your own calendar types.

Installation

Install as usual with composer.

composer require drupal/taarikh:^1.0

The date field uses the jQuery Calendars library by Keith Wood. The module has been tested with version 2.1.0 but the latest version should work as well.

To use composer to download the library as well, follow these steps:

Add the library to composer repositories section as follows:

{
    ...
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        {
            "type": "package",
            "package": {
                "name": "kbwood/jquery.calendars",
                "type": "drupal-library",
                "version": "2.1.0",
                "dist": {
                    "url": "http://keith-wood.name/zip/jquery.calendars.package-2.1.0.zip",
                    "type": "zip"
                }
            }
        },
        ...
}

You may replace the version above as you see fit.

After adding the above entry, run the following command:

Run `composer require kbwood/jquery.calendars`

Usage

This module does not provide a new field type, just widgets and formatters. This means that you are free to switch the widgets and/or formatters for each field separately without losing any date. The data is stored in database as a regular Gregorian date.

This also means that you typically would want to set both widget and formatters. If you just change the widget for a content type, the user would be able to enter the date using the hijri calendar but it would be displayed using the Gregorian calendar when viewing the content. To view it using the Hijri calendar, you would also need to change the formatter.

Using the formatter

Go to the 'Manage display' tab of any content type or entity type. For all date fields, you can now change the formatter to "Taarikh date and time". You can select the algorithm and the format from the settings.

Using the widget

Go to the 'Manage form display' tab of any content type or entity type. For all date fields, you can now change the widget to "Taarikh date and time".

Local Development

We use DDEV to work on this module. The DDEV configuration is ignored from git for two reasons:

  1. It's unnecessary.
  2. It locks in the Drupal version.

Instead, we'll use a script to set up the development environment. Fortunately, ddev-drupal-contrib makes this very easy for us. The steps mentioned there are scripted in ./setup_dev.sh and some more. The script also lets you specify the Drupal version to use (corresponds to DDEV recipes: drupal8, drupal9, and drupal10 as of right now). It also copies a settings.local.php and modifies settings.php to have it take effect.

Usage:

./setup_dev.sh drupal9

This will set up a DDEV site at the address https://taarikh-drupal9.ddev.site (if you have cloned this repo in a directory called taarikh). Now you can install the site and happy testing.

Depends on

Dependencies of the latest stable release

  • datetime Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Nov 2025
Latest release
9 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Core Release date
8.x-1.2 Stable 10–11 Nov 2, 2025