From 4fd78d030a94db6443994778b0a39f56b1e08f71 Mon Sep 17 00:00:00 2001 From: Yemel Jardi Date: Fri, 16 May 2014 13:18:25 -0700 Subject: [PATCH] make dates human friendly --- bower.json | 3 ++- index.html | 16 +++++++++------- js/app.js | 2 ++ js/filters.js | 7 +++++++ 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/bower.json b/bower.json index 7197b53f0..977836dc4 100644 --- a/bower.json +++ b/bower.json @@ -18,6 +18,7 @@ "sjcl": "1.0.0", "file-saver": "*", "qrcode-decoder-js": "*", - "bitcore": "~0.1.19" + "bitcore": "~0.1.19", + "angular-moment": "~0.7.1" } } diff --git a/index.html b/index.html index 0d4f121b8..2daca941d 100644 --- a/index.html +++ b/index.html @@ -368,7 +368,7 @@
-
created at {{tx.createdTs | date:'medium'}}
+
{{tx.createdTs | amCalendar}}
@@ -383,16 +383,16 @@
- + - + - + - + @@ -430,7 +430,7 @@ Sent

- {{tx.sentTs | date:'medium'}}. + . ID: {{tx.sentTxid}} @@ -462,7 +462,7 @@

- {{btx.firstSeenTs * 1000 | date:'medium'}} + {{btx.firstSeenTs * 1000 | amCalendar}}
@@ -680,6 +680,8 @@ on supported browsers please check http://www.w + + diff --git a/js/app.js b/js/app.js index 8852fd0a4..c427845e5 100644 --- a/js/app.js +++ b/js/app.js @@ -20,9 +20,11 @@ var copay = require('copay'); var copayApp = window.copayApp = angular.module('copay',[ 'ngRoute', + 'angularMoment', 'mm.foundation', 'monospaced.qrcode', 'notifications', + 'copay.filters', 'copay.header', 'copay.footer', 'copay.addresses', diff --git a/js/filters.js b/js/filters.js index ad9a93a7c..044ddbdf8 100644 --- a/js/filters.js +++ b/js/filters.js @@ -1 +1,8 @@ 'use strict'; + +angular.module('copay.filters', []) + .filter('amTimeAgo', ['amMoment', function(amMoment) { + return function(input) { + return amMoment.preprocessDate(input).fromNow(); + }; +}]); \ No newline at end of file