Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions 01_01b/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const mainContent = document.querySelector(".main-content");
const Card = (data) => {
const imgData = data[0];

const date = new Date(imgData.created_at)

const markup = `
<figure class="image">
<img
Expand All @@ -34,6 +36,17 @@ const Card = (data) => {
Photo by
<span class="image__photog">${imgData.user.name}</span>.
</p>
<p>
Uploaded on
<time class = "image_date" datetime = "${imgData.created_at}">
${
date.toLocaleString("default",{
year: "numeric",
month: "long",
day: "numeric",
}
)}</time>
</p>
<p>
<a href="${imgData.links.self}" class="image__link">
View it on Unsplash.
Expand Down