x x x
Only portrait mode is currently supported - please rotate your device.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Show If
groupconfluence-administrators,judging-administrators


Custom section
CustomCSSflex-direction: column;
ContainerIDall-events
Classev-cards-section


HTML
<h2 class="ev-cards-section-title" style="margin-bottom: 60px;">Unpublished Events</h2>


ConfiForms CleanView
filterpublish:false
pageTitleCreate Event
formNamecreateEvent
sortstartDate ASC







HTML
	</div>
</div>


HTML
<style>
#unpublished-events .conf-macro.output-block[data-macro-name=confiform-cleanview] {
    padding: 0px 35px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 280px);
    grid-gap: 20px;
    height: auto !important;
    justify-content: space-evenly;
}
</style>
<script>

const replaceDates = () => {
  let myEventsSection = document.getElementById("scroll-section-0");
  let upcomingEventsSection = document.getElementById("scroll-section-1");
  let pastEventsSection = document.getElementById("scroll-section-3");
  let allEventsSection = document.getElementById("all-events");

  let allSections = [
    myEventsSection, upcomingEventsSection, pastEventsSection, allEventsSection
  ];

  for (let i = 0; i < allSections.length; i++) {
    let currSection = allSections[i];
    console.log("CURR SECTION:", currSection.id.toUpperCase());
    
    let currSectionCards = Array.from(currSection.getElementsByClassName("eventcard"));

    for (let j = 0; j < currSectionCards.length; j++) {
      let card = currSectionCards[j];
      let UTCdate = card.dataset.startdate;

      if (!UTCdate) {
        break;
      }

      console.log("Start Date:", UTCdate);
      let localDateStr = new Date(UTCdate).toLocaleString('en-US');
      console.log("localDateStr:", localDateStr);
      let localDate = new Date(localDateStr);
      console.log("localDate:", localDate);
  
      formatDate2(localDate).then(datetimeStr => {
        console.log("datetimeStr:", datetimeStr);
        datetimeStr = datetimeStr.split(" on ");
        let timeStr = datetimeStr[0];
        let dateStr = datetimeStr[1];
  
        card.getElementsByClassName("formattedDatetime")[0].innerText = timeStr;
        card.getElementsByClassName("formattedDate")[0].innerText = dateStr;
      });
    };
  }
}

window.addEventListener('load', () => {
	replaceDates();
});
</script>

...