Skip to content

Instantly share code, notes, and snippets.

@janizde
Last active December 10, 2020 23:30
Show Gist options
  • Save janizde/2fd6b5162d97a7261512ce65913924c9 to your computer and use it in GitHub Desktop.
Save janizde/2fd6b5162d97a7261512ce65913924c9 to your computer and use it in GitHub Desktop.
Change date range format in Overview Widget
<?php
add_filter('op_shortcode_markup', function ($markup, $shortcode) {
if ($shortcode instanceof \OpeningHours\Module\Shortcode\IsOpen) {
return preg_replace('/(\d{2}:\d{2}) - (\d{2}:\d{2})/', '$1–$2', $markup);
}
return $markup;
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment