<script>
  (function () {
	if (window.NodeList && !NodeList.prototype.forEach) {
		NodeList.prototype.forEach = Array.prototype.forEach;
	}

	document.addEventListener('readystatechange', event => {
		if (document.readyState === 'complete') {
			init();
		}
	});

	$( document ).ajaxComplete(function() {
		$( ".log" ).text( "Triggered ajaxComplete handler." );
	});

	function init() {
		var monthlyEl = document.querySelectorAll('.item.item--ongoing');
		var elements = document.querySelectorAll('.event-time-12hr');
		console.log('item--ongoing', monthlyEl.length);
		console.log('event time', elements.length);

		if (elements) {
			elements.forEach(function (el) {
				var time = el.textContent;
				var indexOfPm = time.indexOf('PM');

				var newTime = time.substring(0, indexOfPm + 2);

				if (indexOfPm > -1) {
					el.textContent = newTime;
				}
			});
		}
	}

	new MutationObserver(function () {
		init();
		// myFunction2(); , etc...
	}).observe(document.body, { attributes: true, attributeFilter: ['class'] });
})();

  </script>