The module screenshots show a date rage input field with the end time field shown but the end date field not shown - this is exactly what I'm trying to set up.

However I haven't found any option to do this in Smart Date.

Does it require some additional module to be able to not show the end date input and automatically use the start date as the end date, but enable end time to be input?

Comments

Robert Castelo created an issue. See original summary.

mandclu’s picture

This is a configuration option in the widget settings. Here's a screen shot:

joewhitsitt’s picture

@mandclu, we are noticing a regression as we update from 3.4.2 to 3.5.1

We have a data range with time field where we have 0 as the only duration option. Though we have this form option set, it is only hiding the input, not the label.

Before the label was getting an inline style display: none;

I was able to reproduce this on simpletestme using the smart date starter kit (smart_date was not an option) which grabs smart_date 3.5.1

joewhitsitt’s picture

mandclu’s picture

Not sure if it's related, but please check out the patch posted to #3269460: JS Error - Allowed duration increments - key = 0 to see if it has any impact on the issue reported here

joewhitsitt’s picture

@mandclu

I just tested that #6 patch and it doesn't hide the datetime-wrapper.html.twig label. Looks like https://git.drupalcode.org/project/smart_date/-/commit/78ad8bb had to be very specific to overcome the core template. Looks like core is looking to re-write it to be easier to work with: https://www.drupal.org/project/drupal/issues/3078334

I didn't mean to hijack this issue and can open a separate issue if needed.

mandclu’s picture

StatusFileSize
new28.32 KB

It's somewhat of a hijack, but related enough that we may as well keep going, and maybe it will inform an answer for the original post.

@joewhitsitt when I try to follow the steps you describe using SimplyTest.me, here's what I see:

That seems like what you're looking for, no?

joewhitsitt’s picture

Looks like there is a difference between "Smart Date and time range" and "Smart Date inline range." This appears to work for inline range which is why I missed it when testing as we are using the "time range" version.

mandclu’s picture

StatusFileSize
new33.25 KB

OK, with that extra piece of information, I can now reproduce what you're seeing.

Is there a reason for using the older widget in this case? Especially if zero duration is the only allowed value, it doesn't seem as though the labels are adding any value.

I should still probably fix it, but I would guess that this is only an issue in the Seven theme, which is basically deprecated at this point.

joewhitsitt’s picture

I am a bit fuzzy on the original work, but maybe this was the solution at the time and we didn't read through newer release notes and switch off of it. We can evaluate the other widget soon and see if it works for our use-case.

We first noticed this in Claro and reproduced it in Seven because we wanted to make sure it wasn't a claro thing.

pyrello’s picture

damienmckenna’s picture

Version: 3.5.0-rc1 » 4.2.x-dev