Edit from-to format of time

[ad_1]

Plugin Author
room34

(@room34)

At the moment there’s not any kind of wrapper around the delimiter, so what you’re talking about couldn’t be done with CSS, but it could be done with JavaScript/jQuery. (Ideally I should make it an editable parameter… I’ll look into adding that in a future update.)

If you were to do it in jQuery it would look something like this:

jQuery(document).on('r34ics_init_end', function() {
jQuery('.ics-calendar .end_time').each(function() {
var text = jQuery(this).text();
text.replace('–', '…');
jQuery(this).text(text);
});
});

This should work, but it may not perform very well, especially if you have a lot of events in your calendar. This is something that really should be done on the server side, so we’re back to me adding it as a parameter in the shortcode.

(Also just a note… the text in the first .replace parameter is supposed to be ampersand code #8211; but the forum converts it to the en dash character.)

  • This reply was modified 25 minutes ago by room34.
  • This reply was modified 23 minutes ago by room34.

Thank you very much for your prompt reply and the clarification! Since it is mainly a visual/grammatical feature, I might refrain from using jQuery here and patiently wait for the parameter to be implemented some time in the future. Thank you!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer