Skip to content

Commit

Permalink
add timestamp to IA links
Browse files Browse the repository at this point in the history
  • Loading branch information
willf committed Jan 13, 2025
1 parent 21edf96 commit 401df5a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3581,6 +3581,17 @@
disabled: !1,
},
];
function generateTimestamp() {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, "0"); // Months are zero-based
const day = String(now.getDate()).padStart(2, "0");
const hour = String(now.getHours()).padStart(2, "0");
const minute = String(now.getMinutes()).padStart(2, "0");
const second = String(now.getSeconds()).padStart(2, "0");

return `${year}${month}${day}${hour}${minute}${second}`;
}
function loadFipsCodes() {
const stateSelect = document.getElementById("stateSelect");
const countySelect = document.getElementById("countySelect");
Expand Down Expand Up @@ -3665,7 +3676,7 @@
const state = selectedCounty.state;
const countyFips = selectedCounty.county_fips;
const county = selectedCounty.county;
const date_prefix = "99999999999999";
const date_prefix = generateTimestamp();
//https://github.com/edgi-govdata-archiving/CDC_EIJ_DATA_16_Idaho/blob/main/16001_Ada_County_Idaho.pdf
const urlPath =
`${date_prefix}/https://eji.cdc.gov/documents/data/2024/countymaps/${stateFips}_${state}/${countyFips}_${county}_${state}.pdf`.replace(
Expand Down

0 comments on commit 401df5a

Please sign in to comment.