forked from OutlawAndy/relativeDate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
45 lines (45 loc) · 1.7 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
<!DOCTYPE html>
<html>
<head>
<title>RelativeDate</title>
<link href="http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.13.0/css/semantic.css" rel="stylesheet" type="text/css">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js"></script>
<script src="relativeDate.js"></script>
</head>
<body ng-app="MyApp">
<div class="ui grid">
<div class="column" ng-controller="AppCtrl">
<div class="ui piled segment" style="margin:100px auto;padding:100px;text-align:center;">
<h1 class="ui header"><a href="http://github.com/outlawandy/relativeDate">RelativeDate</a> Demo</h1>
<div class="ui horizontal icon divider">
<i class="teal time icon"></i>
</div>
<div class="ui stacked segment">
<div class="ui header">This page was loaded
<div class="ui teal label">{{relNow}}</div>
</div>
</div>
<div class="ui stacked segment">
<div class="ui header">1 day before this page loaded was
<div class="ui teal label">{{relDay}}</div>
</div>
</div>
</div>
</div>
</div>
<script>
var MyApp = angular.module('MyApp',['relativeDate'])
MyApp.controller('AppCtrl', function($scope, relativeDate) {
var now = new Date();
var day = new Date(now - 86400000);
relativeDate.set(now, function(rel) {
$scope.relNow = rel;
});
relativeDate.set(day, function(rel) {
$scope.relDay = rel;
});
});
</script>
</body>
</html>