No end date/time field if 'custom' is the only allowed duration value

Created on 8 January 2025, 13 days ago

Problem/Motivation

If custom is the only allowed duration value the end time field is not visible. I have to select and deselect the all_date checkbox to make the end time field visible.

The end date field is also not visible. Also if the widget option "Hide the end date field unless it's different from the start date." is enabled. I do not get it how it works at all, so I deselected the option.

Steps to reproduce

Create a smart_date field with Recurring enabled and set to 12 month ahead.
Set default date value to current_date
Set Allowed duration value only to custom
Set default duration to 0

Proposed resolution

🐛 Bug report
Status

Active

Version

4.2

Component

Code

Created by

🇩🇪Germany sunlix Wesel

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

Comments & Activities

  • Issue created by @sunlix
  • 🇩🇪Germany sunlix Wesel

    I digged a little bit into it.

    I think the main problem is that if custom is the only allowed value in the duration_increments you can't set custom for the default_duration. It will be casted to 0 because the config schema requires integer.

    By that in the smart_date.js the setInitialDuration function hide the end date and end time field.
    This hiding is intended for non custom values. But duration can't be initially set to custom due to the integer casting for default_duration

  • 🇩🇪Germany sunlix Wesel
Production build 0.71.5 2024