-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
51 lines (39 loc) · 1.68 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
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Jquery Timeago</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="card" style="width: 40rem;margin-top: 20vh;margin-left: 40vh;">
<div class="card-body">
<h5 id="timer1" class="card-title">Timeago demo</h5>
<p class="card-text">Original Date:August, 16th 2018 </p>
After Using Timeago ::
<time class="timeago" datetime="2018-08-16T09:24:17Z"></time>
<button type="button" id="update" class="btn btn-secondary">Update</button>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="jquery.timeago.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
<script>
$(document).ready(function () {
//init timeago
$(".timeago").timeago();
//Update timestamp programatically
$('#update').on('click', function () {
$(".timeago").timeago("update", new Date());
})
});
</script>
</body>
</html>