Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Cms 2.1.4 Update released for Drupal core (2.1.4)! Release: Drupal 12.0.0-alpha1 First alpha version released for Drupal core (12.0.0-alpha1). Release: PhotoSwipe - Responsive JavaScript Modal Image Gallery 5.0.9 Minor update available for module photoswipe (5.0.9). Release: AI (Artificial Intelligence) 1.4.8 Minor update available for module ai (1.4.8). Release: AI (Artificial Intelligence) 1.3.13 Minor update available for module ai (1.3.13). Release: Moderated Content Bulk Publish 2.0.53 Minor update available for module moderated_content_bulk_publish (2.0.53). Release: Mailchimp 2.2.9 Minor update available for module mailchimp (2.2.9). Release: Mailchimp 3.1.4 Minor update available for module mailchimp (3.1.4). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Module Revived: Block Token 8.x-1.3 Module block_token updated after 18 months of inactivity (8.x-1.3).

Calculate Working Days

Security covered Drupal 8–10 · not 11
View on drupal.org

Calculate Working Days
----------------------------------

Calculate Working Days is a module that allows you to calculate working days
between 2 dates or the final date given an initial date
and the number of working days.
It also can calculate which days in a month are free or working days.

CONTENTS OF THIS FILE
-----------------------------------

* Introduction
* Requirements
* Installation
* Configuration
* Maintainers

REQUIREMENTS
-----------------------
This module requires a date picker library.

INSTALLATION
---------------------

*Install as you would normally install a contributed Drupal module. Visit
[Installing Modules](https://www.drupal.org/docs/extending-drupal/installing-modules) for further information.

CONFIGURATION
-------------------------

To use:

1. Navigate to Administration > Extend > And Search
for Calculate Working Days Module
2. Enable the working days Module.
3. Go to URL "/admin/config/regional/calculate-working-days"
4. Do the configuration for free days of the week.
5. Enter the day month and special occasions.

FUNCTIONS OVERVIEW
---------------------------------

1. calculate_working_days_get_work_days
Description:
Calculates the number of working days between two given dates (inclusive).

Arguments:

$start_date (int): The starting date as a Unix timestamp.

$final_date (int): The ending date as a Unix timestamp.

Returns:
(int): Number of working days between the two dates.

Example Usage:

$start_date = strtotime('2025-01-01');
$final_date = strtotime('2025-01-10');
$work_days = calculate_working_days_get_work_days($start_date, $final_date);

2. calculate_working_days_get_work_days_monthly

Description:
Calculates the number of working days in a specified month and year.

Arguments:

$month (int): The month (1 for January, 12 for December).

$year (int): The year (must be greater than 1970).

Returns:

(int): Number of working days in the given month and year.

Example Usage:

$month = 1; // January
$year = 2025;
$work_days = calculate_working_days_get_work_days_monthly($month, $year);

3. calculate_working_days_get_free_days_monthly

Description:
Calculates the number of free days (non-working days) in a specified month and year.

Arguments:

$month (int): The month (1 for January, 12 for December).

$year (int): The year (must be greater than 1970).

Returns:

(int): Number of free days in the given month and year.

Example Usage:

$month = 1; // January
$year = 2025;
$free_days = calculate_working_days_get_free_days_monthly($month, $year);

4. calculate_working_days_get_end_date

Description:
Calculates the end date given a start date and a number of working days.

Arguments:

$start_date (int): The starting date as a Unix timestamp.

$days (int): The number of working days to calculate.

Returns:

(int): The calculated end date as a Unix timestamp.

Example Usage:

$start_date = strtotime('2025-01-01');
$days = 10;
$end_date = calculate_working_days_get_end_date($start_date, $days);

Notes

Timestamp Requirement: All date-related arguments are required to be Unix timestamps for consistency.

Error Handling: Validate input arguments before passing them to these functions to avoid unexpected results.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Sep 2026
Latest release
1 day ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
2.0.3 Stable 8–10 Sep 1, 2026