Last active
November 3, 2018 11:12
-
-
Save jsrath/1e02fcea1fe588fe663ef971372cd7b5 to your computer and use it in GitHub Desktop.
This file contains 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
async function getData(event) { | |
event.preventDefault(); | |
document.querySelector('.output').classList.add('visible'); | |
let createdDate; | |
let data = []; | |
const user = document.getElementById('username').value; | |
await fetch(`https://api.github.com/users/${user}`) | |
.then(response => response.json()) | |
.then(response => (createdDate = response.created_at)); | |
const createdDay = new Date(createdDate).getMonth(); | |
const createdMonth = new Date(createdDate).getDate(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment