DRUPAL MODULE / CONTENT & EDITING

HMS Field (Hours Minutes Seconds)

Stores time values as integers and lets editors enter and display them in hours, minutes and seconds.

What it does.

HMS Field stores a time value as an integer while letting people enter and read it as hours, minutes or seconds. It bridges a machine-friendly value with a display that is easier to understand in duration-oriented content.

Input and output formats can be chosen separately from the formats documented by the project. Developers can alter the available formats through a hook, making the field adaptable when the standard hour, minute and second combinations do not fit the content.

Capabilities.

  • Integer-backed time values
  • Separate input and output formatting
  • Hour, minute and second combinations
  • Developer hook for additional formats

Using the module.

  1. Configure the field’s input and output formats for the desired duration representation.
  2. Use hook_hms_format_alter when a custom format is needed.
Open the official project

Project notes.

The project is minimally maintained. WS’s role is the initial Drupal 8 port and work on that version; the page attributes later Drupal 9 and 10 development to Entityone / make it fly.

Our contribution.

Initial Drupal 8 port, plus development and maintenance of that version.

This records WS’s contribution to this community project, alongside its other contributors. View the organization’s supported projects ↗

Original sources.

Your next chapter

The future doesn’t
build itself.

Bring the ambition.
We’ll bring the people, the agents, and the know-how.