Timeslot input title should use formatPlural()

Created on 23 June 2023, over 1 year ago
Updated 28 June 2023, over 1 year ago

Problem/Motivation

Having an increment of 1 and editing a time slot I get a title in the input:
<input title="Time, with an increment of 1 minutes (e.g. 15:55)" type="time">
where it should be
<input title="Time, with an increment of one minute (e.g. 15:55)" type="time">
or
<input title="Time, with an increment of 1 minute (e.g. 15:55)" type="time">

Steps to reproduce

Set up a node with an office_hours field with "Time increments" of 1.
Then edit the node.

Proposed resolution

In src/Element/OfficeHoursDatetime.php in function processDatetime() use \Drupal::translation()->formatPlural() instead of t() with '@count' instead of '@step'.

Remaining tasks

Review patch.

User interface changes

Better title in input field.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code - widget

Created by

🇩🇪Germany gngn

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024