Last active
January 19, 2022 15:44
-
-
Save mluerig/6a1b89ac2b0c4ef2fb72c7131a0b89f7 to your computer and use it in GitHub Desktop.
getting the latest mod date-time for websites
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repo_api_link = "https://api.github.com/repos/phenopype/phenopype-lander/commits"; | |
function ModifiedDateTime() { | |
fetch(repo_api_link).then((response) => { | |
return response.json(); | |
}) | |
.then((commits) => { | |
var dat = commits[0]['commit']['committer']['date']; | |
document.getElementById('last-modified-datetime').textContent = dat.slice(0,10) + " " + dat.slice(11,19) ; | |
}); | |
} | |
ModifiedDateTime() | |
function ModifiedDate() { | |
fetch(repo_api_link).then((response) => { | |
return response.json(); | |
}) | |
.then((commits) => { | |
var dat = commits[0]['commit']['committer']['date']; | |
document.getElementById('last-modified-date').textContent = dat.slice(0,10); | |
}); | |
} | |
ModifiedDate() | |
function ModifiedYear() { | |
fetch(repo_api_link).then((response) => { | |
return response.json(); | |
}) | |
.then((commits) => { | |
var dat = commits[0]['commit']['committer']['date']; | |
document.getElementById('last-modified-year').textContent = dat.slice(0,4); | |
}); | |
} | |
ModifiedYear() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment