forked from blocvox/jquery-friendlyTime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
30 lines (28 loc) · 1.13 KB
/
demo.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
<html>
<head>
<script src="http://requirejs.org/docs/release/2.1.15/minified/require.js"></script>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<!-- <script src="jQuery.friendlyTime.js"></script> -->
</head>
<body>
<span class="date" data-time="2014-11-11T07:12:30Z">...</span>
<br/>
<span class="date date_ready" data-time="2014-11-10T01:52:20Z">Just Now</span>
<script type="text/javascript">
require([ 'jquery', 'jQuery.friendlyTime' ], function($) {
$.fn.friendlyTime.DURATION = 1000;
$('.date.date_ready').friendlyTime({ skipInit: true });
// Given the above, this could also be $('.date:not(.date_ready)'), but not
// necessary. friendlyTime won't track already-tracked elements more than once.
$('.date').friendlyTime({
//suppressFuture: true,
//nowWindow: 5
});
setTimeout(function(){
//$('.date').friendlyTime({ stopUpdates: true });
$('.date').remove();
}, 5000);
});
</script>
</body>
</html>