From daa5c381fc36261b0795c1a437859bacc5655465 Mon Sep 17 00:00:00 2001 From: vachan-maker Date: Mon, 19 Aug 2024 17:35:11 +0530 Subject: [PATCH] Added date to epic page --- epic.html | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/epic.html b/epic.html index 9b91a8b..e3d8e52 100644 --- a/epic.html +++ b/epic.html @@ -23,7 +23,6 @@

Earth Polychromatic Imaging Camera

-

@@ -43,11 +42,8 @@

} const data = await response.json(); var epicDate = new Date(data[5].date); - console.log(epicDate); - console.log(epicDate.getFullYear()); - - const titleElement = document.getElementById("epic-title"); - titleElement.innerText = data.title; + const epicDateElement = document.getElementById('epic-date'); + epicDateElement.innerText = epicDate; epicImageURL = data[5].image; const epicImage = `https://api.nasa.gov/EPIC/archive/natural/${epicDate.getFullYear()}/${('0'+ (epicDate.getMonth()+1)).slice(-2)}/${epicDate.getDate()}/png/${epicImageURL}.png?api_key=${api_key}` ; const imageElement = document.getElementById("epic-image");