civichackingagency / scangov

Government digital experience monitor
https://scangov.org
9 stars 1 forks source link

Put data updated info on the profile pages where we had them before and don't show universally on the site #105

Closed lukefretwell closed 4 months ago

lukefretwell commented 5 months ago

<div class="container mt-3">
  <div class="row">
    <div class="col-12">
      <p class="text-muted">
        <small>Updated:
          <span id="updated"></span>
          (<a href="/docs/data">Data</a>
          &middot;
          <a href="https://github.com/civichackingagency/scangov/issues/new?assignees=Narlotl&labels=data+update&projects=&template=data-update-request.md&title=Update+data%3A+%5BDOMAIN%5D">
            Request update</a>)
        </small>
        <script>
          fetch('https://api.github.com/repos/civichackingagency/scangov/commits?path=/data&per_page=1').then(res => res.json()).then(data => {
            document.getElementById('updated').innerHTML = new Date(data[0].commit.author.date).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' });
          });
        </script>
      </p>
    </div>
  </div>
</div>
lukefretwell commented 5 months ago

@Narlotl removing this but added code to issue as I can't figure out where to put this.