Simple string replacement in views output?
In your custom module, create module_name.views.inc file and add following code.

&lt;?php
use \Drupal\views\ViewExecutable;
use \Drupal\views\Plugin\views\cache\CachePluginBase;

function custom_module_views_post_render(ViewExecutable $view, &amp;$output, CachePluginBase $cache) {
  if ($view-&gt;id() == 'VIEW_NAME') {
    $html = \Drupal::service('renderer')-&gt;renderRoot($output['#rows']);
    $replace_pairs = array(
      ' am ' =&gt; ' a.m. ',
      ' pm ' =&gt; ' p.m. ',
    );
    $html =  strtr($html, $replace_pairs);

    $output['#rows'] = $html;
  }
}


Replace VIEW_NAME with your view name and clear drupal cache.