Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request semana 4 #126

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
122 changes: 122 additions & 0 deletions student-blogs/kay-6528/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="./styles/main.scss">
<title>Card Layout</title>
</head>
<body>
<header class="header help">
<div class="logo">logo</div>
<div class="list-container">
<ul class="list">
<li>
<a href="">About</a>
</li>
<li>
<a href="">Two</a>
</li>
<li>
<a href="">Sign up</a>
</li>
</ul>
</div>
</header>
<main class="main help">
<div class="item">
<img class="item-image" src="" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
<div class="item">
<img class="item-image" src="" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
<div class="item">
<img class="item-image" src="g" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
<div class="item">
<img class="item-image" src="" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
<div class="item">
<img class="item-image" src="" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
<div class="item">
<img class="item-image" src="" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
<div class="item">
<img class="item-image" src="" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
<div class="item">
<img class="item-image" src="" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
<div class="item">
<img class="item-image" src="" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
<div class="item">
<img class="item-image" src="" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
<div class="item">
<img class="item-image" src="" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
<div class="item">
<img class="item-image" src="" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
<div class="item">
<img class="item-image" src="" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
<div class="item">
<img class="item-image" src="" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
<div class="item">
<img class="item-image" src="" alt="">
<div class="item-tags">
<span>Tag</span><span>Tag</span>
</div>
</div>
</main>
<div class="sidebar help"></div>
<footer class="footer help">
<div class="design-message">Designed by Suru</div>
</footer>
</body>
</html>
25 changes: 25 additions & 0 deletions student-blogs/kay-6528/main.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

//Fechas Humanizadas
import daysjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime.js';
daysjs.extend(relativeTime);

await import("dayjs/locale/es-us.js");
daysjs.locale("es-us");

function humanizedDate(date) {
const wrappedDate = daysjs(date);
const daysDiff = Math.abs(wrappedDate.diff(Date.now(), "days"));

const isCurrentYear = wrappedDate.year() === new Date().getFullYear();

if(!isCurrentYear) {
return wrappedDate.format("MMMM DD, YYYY")
} else if(daysDiff <= 30){
return wrappedDate.fromNow();
} else {
return wrappedDate.format("MMMM DD")
}
}

console.log(humanizedDate("1996 09 25"));
Loading