Posted: June 9, 2015 at 10:42 am
|
Hey guys – I’m using the Table Template Add-On and “A better Events table template” from Josh. I’m curious – How can I hide/remove the TIME from the DateTime display? (screenshot for reference) Frankly, I would like to do this across the entire front-end of the application. Anywhere the date and time are listed, I would prefer to show only the date. Our events are day-based, without listed times. But, for the scope of this thread, feel free to limit your solution to this table template. Thanks,
|
Hi Phil, for the Events table view template add-on, see this tutorial: https://gist.github.com/lorenzocaum/ac217033f12232404cce#comment-1360330 For the datetimes that are used on the event listings page and the single event pages see this tutorial: https://eventespresso.com/topic/format-date-and-time-in-ee4/#post-93329 In the last step where you change the function to add the specified format, try this version: ID, $dt_frmt = 'l F jS, Y', $tm_frmt = '' );?> That should keep the date and remove the time. — |
|
|
Very nice. The first solution works flawlessly. Thank you very much. The second would work, I presume, though I haven’t tested it yet. On my single event template, I’m echoing the function espresso_event_date_range(). I updated this to be Any word on what to do differently with that function? |
Okay, no problem. The date range function is used in the example for the events table view template. What happens if you use the same example in your single event template? — |
|
|
Using Using This code is being called within a single-espresso_events.php template file in my child theme. |
|
I’m embarrassed to admit this…. The start and end date for the event that I was testing this on were the same! This solution works. A range is returned, in the desired format! Thank you guys. |
|
It’s always the simple things (for me, it’s always a missing comma somewhere in my code…)! Anything else we can help with regarding this issue or may we mark this as resolved? |
|
Resolved. 🙂 |
The support post ‘Removing the Time from Datetime in the Table Template Add-On’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.