Compact date/time range formatter

Categories

Component ID

2870347

Component name

Compact date/time range formatter

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

267

Component created

Component changed

Component body

The compact date/time range formatter module provides the ability to display date/time range fields in a more compact form, by omitting the month or year where it would be duplicated.

Examples:
24–25 January 2017 (range is within a single month)
29 January–3 February 2017 (range is within a single year)
9:00am–4:30pm, 1 April 2017 (range is within a single day)

This module defines a new configuration entity, date_range_format, to store patterns for date range formats, in a similar way to Drupal's core date formats. Variations can be configured for use where the day, month or year is the same for both start and end date.

Both date-only and date & time ranges are supported.

To configure date/time range formats, visit Administration » Regional and language » Date and time range formats. The patterns use the same PHP date/time formatting tokens as Drupal's core date formats.