Skip to content

Commit 6c7a0b7

Browse files
committed
Implement to24hourtime function and add initial HTML test page
1 parent b28011e commit 6c7a0b7

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

Sprint-1/prep/example.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
//percentage exercise
1+
function to24hourtime(hour, minute, period) {
2+
//if the period is pm then add 12 to hours.
23

3-
const decimalNumber = 0.5;
4+
if ((hour = "12") && (minute = "00")) {
5+
return "0000";
6+
}
7+
}
48

5-
const percentage = `${decimalNumber * 100} %`
9+
//for hours and minute make sure they are in 3 digit.
10+
//return the hours and minute as a 4 char string.
611

7-
console.log(percentage);
12+
// hour will always range from 1 to 12 (inclusive)
13+
// minute will always range from 0 to 59 (inclusive)
14+
// period will always be either "am" or "pm"
15+
16+
console.log(to24hourtime());

Sprint-1/prep/test.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1.0 "
8+
/>
9+
<title>Test Page</title>
10+
</head>
11+
12+
<body>
13+
<h1>Hello, World!</h1>
14+
<p>This is a test page.</p>
15+
<p>Testing 123...</p>
16+
<p>Another paragraph for testing.</p>
17+
<h2>Subheading</h2>
18+
<p>More content goes here.</p>
19+
<footer>
20+
<p>Footer content</p>
21+
</footer>
22+
</body>
23+
</html>

0 commit comments

Comments
 (0)