Duration field stays hidden when unchecking All day for saved events

Created on 27 September 2022, about 2 years ago
Updated 27 January 2023, almost 2 years ago

Problem/Motivation

The Duration field does not show up when All day is unchecked while editing a node, which was originally saved with 2 same dates and all day checked.

Before

After

Steps to reproduce

1. Create a new node which uses smart date module
2. Check All Day
3. Choose both the dates to be same
4. Save the node
5. Edit the node
6. Uncheck All Day
7. Duration field does not appear

Proposed resolution

The logic I have used with this patch checks if

the start date and end date field have been set, that is they are not empty
(which ideally they shouldn't, since we are re-editing this existing node)
for eg: start_date.value !== ''

and if the condition is successful
unset the style.display = 'none' to style.display = ''
and instead add style.visibility = 'hidden'

so now when All Day checkbox changes, the checkAllDay() function
will change the visibility attribute to 'visible' or 'hidden'

🐛 Bug report
Status

Fixed

Version

3.7

Component

User interface

Created by

🇨🇦Canada metasim

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024