- Issue created by @michaelschutz
- 🇨🇦Canada mandclu
Theoretically it might be possible to create a views filter along the lines of "is all day" which sounds like it would accomplish what you want. The big downside is that it would be very slow.
I would suggest adding a calculated field to store this value instead, and then filter on that in your view.
The
smart_date.manager
service has a method you could use to make this calculation:
public static function isAllDay($start_ts, $end_ts, $timezone = NULL)
The above will return a boolean.
- 🇨🇦Canada michaelschutz
Much appreciated mandclu. I may be out of my depth here, but I'll start there and see what I can make happen.
I don't actually want to filter the view to show only all-day events, so I'm not sure a filter would work anyway. I just want to "filter" the visibility of the "All-day" text. But if I can get a boolean for that in a calculated field, then I could use Twig to conditionally hide the Date->Start field. Thanks for pointing me in a helpful direction.
- Status changed to Closed: works as designed
over 1 year ago 9:20pm 24 May 2023 - 🇨🇦Canada michaelschutz
Just circling back to close this loop...
I went with the super-simple option of using Twig in the field rewrite box to evaluate the start time string - i.e. {% if field_event_date_value != "12:00am" %}
Probably not the best way to do it, but with my limited time and skill, it works. :)
Thanks again.