diff --git a/index.html b/index.html
index 9666d16..f978e7c 100644
--- a/index.html
+++ b/index.html
@@ -246,24 +246,31 @@
- Source:
+ Sources:
Fox News, the
+ target="_blank">Fox News,
District of Columbia Board of Elections, and
- the
Alaska
- Division of Elections. Data compiled by:
+ Division of Elections.
+
Data compiled by:
Tony McGovern. Alaska data last updated: {{
- alaska.lastupdated
- }}. Continental U.S. data last updated: {{ continental.lastupdated }}.
+ target="_blank">Tony McGovern.
+
+
+
+
+ Alaska data last updated: {{ alaska.lastupdated }}.
+
Washington D.C. data last updated: {{ dc.lastupdated }}.
+
Continental U.S. data last updated: {{ continental.lastupdated }}.
+
-
- Hover over and click on the map to explore
+
+
Hover over and click on the map to explore
+
@@ -338,6 +345,9 @@
alaska: {
lastupdated: ""
},
+ dc: {
+ lastupdated: ""
+ },
continental: {
lastupdated: new Date().toLocaleString(),
},
@@ -381,6 +391,7 @@
);
const dcGeographies = await this.getDCGeographies();
await this.fetchDCResults(dcGeographies);
+ await this.fetchDCUpdatedDate();
const akGeographies = await this.getAlaskaGeographies();
await this.fetchAlaskaResults(akGeographies);
await this.fetchElectionResults(censusStates, censusGeographies);
@@ -975,6 +986,14 @@
);
this.districtObj = { ...this.districtObj, ...countyResults };
},
+ async fetchDCUpdatedDate() {
+ // Fetch the JSON data from the API
+ const url = `https://us-election-server-2ae36243a2a4.herokuapp.com/dc/results/lastUpdated`;
+ const response = await fetch(url);
+ const data = await response.json();
+
+ this.dc.lastupdated = new Date(data.LastUpdated).toLocaleString();
+ },
async fetchAlaskaResults(akGeographies) {
try {
// Fetch the JSON data