forked from cypress-io/cypress-example-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
42 lines (39 loc) · 1.01 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<head>
<style>
.badge {
display: inline-block;
min-width: 10px;
padding: 3px 7px;
font-size: 12px;
font-weight: 700;
line-height: 1;
color: #fff;
text-align: center;
white-space: nowrap;
vertical-align: middle;
background-color: #777;
border-radius: 10px;
}
</style>
</head>
<body>
<div>
<span id="shipped"></span>
</div>
<div class="posted">
Posted at <span class="badge badge-primary">3:38 PM</span>
</div>
<script>
const padLeftZero = (s) => s.length < 2 ? '0' + s : s
const span = document.getElementById('shipped')
// let's output the today's date in "MMM, DD YYYY" format
const months = [
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
]
debugger
const d = new Date()
const formatted = months[d.getMonth()] + ' ' +
padLeftZero(String(d.getDate())) +', ' + d.getFullYear()
span.innerText = `Order shipped on: ${formatted}`
</script>
</body>