I'd like to display the Time of an event (e.g. "8:00 PM to 00:45 AM") in the Map (w/list) view.
I noticed that the variable 'stec_replace_date' displays a string like "Oct 28 2020 20:00 - Oct 29 00:45". Could I replace the value of this variable using a function on the functions.php, so that I don't touch the page template? If not, what would be the most efficient / less ugly way to accomplish this?
It turns out this filter overrides the date format only and the time is attached after... I'll have to revisit this code at some point because even I am starting to wonder why it is done this way.
Meanwhile use this filter instead:
add_action('wp_footer', function() { global $post; if (!is_a($post, 'WP_Post') || !has_shortcode($post->post_content, 'stachethemes_ec')) { return; } ?> <script type="text/javascript"> (function ($) { $(function () { if (typeof $.stecExtend === 'undefined') { return; } $.stecExtend(function (m) { m.$instance.on('stecBeforeReturnEventPreviewHtml', function (a, data) {
var preview, event, sd, ed, html, timeFormat, timeString = [];
I'd like to display the Time of an event (e.g. "8:00 PM to 00:45 AM") in the Map (w/list) view.
I noticed that the variable 'stec_replace_date' displays a string like "Oct 28 2020 20:00 - Oct 29 00:45". Could I replace the value of this variable using a function on the functions.php, so that I don't touch the page template? If not, what would be the most efficient / less ugly way to accomplish this?
Thanks!
Try this mod:
Stachethemes Developer
Excellent, thank you sir! I'll play with this :)
It turns out this filter overrides the date format only and the time is attached after... I'll have to revisit this code at some point because even I am starting to wonder why it is done this way.
Meanwhile use this filter instead:
Stachethemes Developer
Excellent, thanks!