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

Fixed incorrect text #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 3 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
15 changes: 8 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>How old is Casper?</title>
<title>How long has "r e m i" been a C# Developer?</title>
<!-- haha remi -->
<style>
html,
body {
Expand Down Expand Up @@ -49,7 +50,7 @@
var DAY = HOUR * 24;
var WEEK = DAY * 7;

var birthday = new Date('2019-04-03T12:26:00');
var birthday = new Date('2019-02-11T09:00:00.000Z');
toxicgorilla marked this conversation as resolved.
Show resolved Hide resolved
var now = new Date();

const hours = (from, to) => Math.floor((to.valueOf() - from.valueOf()) / HOUR);
Expand All @@ -69,18 +70,18 @@
years: years(birthday, now),
}

var headline = `${values.years} years old`;
var headline = `${values.years} years`;
if (values.months <= 19) {
headline = `${values.months} months old`;
headline = `${values.months} months`;
} else if (values.years < 2) {
headline = 'nearly 2';
headline = 'over 9000 years';
}
</script>
</head>

<body>
<h1>
Casper is
Remi has been a C# developer for
<script>document.write(headline)</script>
</h1>
<div>
Expand All @@ -90,7 +91,7 @@ <h2>or</h2>
document.write(
Object
.entries(values)
.map(([key, value]) => `<li>${value.toLocaleString()} ${key} old</li>`)
.map(([key, value]) => `<li>${value.toLocaleString()} ${key}</li>`)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jackall3n Can you think of a way to "improve" this? 🧀

.join('')
)
</script>
Expand Down