locked
Calendar View to Hide 12:00 AM RRS feed

  • Question

  • We are trying some javascript via a content editor to hide the "12:00 AM" when viewing the data from a calendar view.

    It's only hiding the first instance...all other strings of "12:00 AM" are still showing.

    <script type="text/javascript">
    var el = document.getElementById('MontlyViewDefault_CalendarView');
    el.innerHTML = el.innerHTML.replace("12:00 AM", "");
    </script>

    Trying this too, but no luck as well:

    var el = document.getElementById('MontlyViewDefault_CalendarView');

    for(var i=0; i < el.length; i++) {
          el[i].innerHTML = el[i].innerHTML.replace("12:00 AM","");
        }

    Friday, February 20, 2015 4:47 PM

Answers

  • Got it with:

    <script type="text/javascript">

    var el = document.getElementsByTagName('a');

    for(var i=0; i < el.length; i++) {
          el[i].innerHTML = el[i].innerHTML.replace("12:00 AM","");
        }

    </script>

    Friday, February 20, 2015 5:33 PM

All replies

  • Tried this too, but no luck

    var el = document.getElementsByTagName('a');

    for(var i=0; i < el.length; i++) {

          el[i].innerHTML = el[i].innerHTML.replaceAll("12:00 AM","");

    }

    Friday, February 20, 2015 5:32 PM
  • Got it with:

    <script type="text/javascript">

    var el = document.getElementsByTagName('a');

    for(var i=0; i < el.length; i++) {
          el[i].innerHTML = el[i].innerHTML.replace("12:00 AM","");
        }

    </script>

    Friday, February 20, 2015 5:33 PM