Problem/Motivation

Currently, datetime_range values must be entered as two dates. I would like to be able to enter a start and duration, such as 2 hours.

Proposed resolution

Create a form display widget which shows a duration field and converts that to the end date when the form is saved. It should be possible to set a default value for the duration without setting a default start date.

Remaining tasks

Implement.

User interface changes

Site builders may select to show a duration field instead of an end date.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

Comments

liam morland created an issue. See original summary.

dww’s picture

FWIW, exactly this feature already exists in https://www.drupal.org/project/datetime_extras

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.