Incorrect validation of time element when steps are activated

Created on 17 February 2025, about 2 months ago

Problem/Motivation

Form validation incorrectly indicates an error when the user choses an option from the time element with steps enabled. This happens when the "other" option is used.

When you add a time element to a form and you enable steps and choose "other" and give it a certain value,

Steps to reproduce

Create a form and use source to add these elements:

tijd_other_45_ok:
  '#type': time
  '#title': tijd_other_45_ok
  '#timepicker': true
  '#min': '09:45:00'
  '#max': '12:30:00'
  '#step': 2700
tijd_other_30_ok:
  '#type': time
  '#title': tijd_other_30_ok
  '#timepicker': true
  '#min': '09:00:00'
  '#max': '12:30:00'
  '#step': 1800
tijd_other_45_nok:
  '#type': time
  '#title': tijd_other_45_nok
  '#timepicker': true
  '#min': '09:30:00'
  '#max': '12:30:00'
  '#step': 2700
tijd_other_30_nok:
  '#type': time
  '#title': tijd_other_30_nok
  '#timepicker': true
  '#min': '09:20:00'
  '#max': '10:20:00'
  '#step': 1800

Now open the form as user and chose the first option in each element. They should all validate but they don't.
For the 45 mins, if the min time of the step-periode is 9:00 it will validate, but when the min time is 9:30 it will fail.

Proposed resolution

The code doesn't take the start time into consideration when calculating the approved step values during validation

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

6.2

Component

Code

Created by

🇧🇪Belgium liezie_d

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024