Skip to content

Commit

Permalink
added last updated date and times
Browse files Browse the repository at this point in the history
  • Loading branch information
tonmcg committed Nov 25, 2024
1 parent c216754 commit defe77c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,15 @@
<a href="https://www.elections.alaska.gov/enr/" target="_blank"><em>Alaska
Division of Elections</em></a>. Data compiled by:
<a href="https://github.com/tonmcg/US_County_Level_Election_Results_08-24/blob/master/2024_US_County_Level_Presidential_Results.csv"
target="_blank">Tony McGovern</a>.
target="_blank">Tony McGovern</a>. Alaska data last updated: {{
alaska.lastupdated
}}. Continental U.S. data last updated: {{ continental.lastupdated }}.
</span>
<br />
<span>Hover over and click on the map to explore</span>
</v-col>
</v-row>
<v-row>
<v-col class="d-flex justify-end" cols="auto">
<v-radio-group v-model="selectedMap" row @change="renderMap">
<template v-slot:label>
Expand Down Expand Up @@ -329,6 +333,12 @@
censusYear: 2024, // base year for the county gazetteer files
suzeraintyFips: ["02", "60", "66", "69", "72", "74", "78"],
},
alaska: {
lastupdated: ""
},
continental: {
lastupdated: new Date().toLocaleString(),
},
map: {
width: 960,
height: 720,
Expand Down Expand Up @@ -818,6 +828,8 @@
const response = await fetch(url, { method: "GET" });
const data = await response.json();

this.alaska.lastupdated = new Date(data.updated).toLocaleString();

// Process candidate names
let candidateNames = data.candidateNames
.map((candidate, index) => ({
Expand Down

0 comments on commit defe77c

Please sign in to comment.