show full date in wallet detail list if the transaction occured more than a day ago

This commit is contained in:
Marty Alcala 2016-11-03 15:50:22 -04:00
parent bddfdac0b1
commit b0e23b7231
2 changed files with 9 additions and 1 deletions

View File

@ -172,6 +172,12 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
return getMonthYear(date1) === getMonthYear(date2);
}
$scope.createdWithinPastDay = function(tx) {
var now = new Date();
var date = new Date(tx.time * 1000);
return (now.getTime() - date.getTime()) < (1000 * 60 * 60 * 24);
};
$scope.isDateInCurrentMonth = function(date) {
var now = new Date();
return getMonthYear(now) === getMonthYear(date);

View File

@ -234,7 +234,9 @@
</span>
</span>
<div>
<time class="wallet-details__tx-time" ng-if="btx.time">{{btx.time * 1000 | amTimeAgo}}</time>
<time class="wallet-details__tx-time" ng-if="btx.time && createdWithinPastDay(btx)">{{btx.time * 1000 | amTimeAgo}}</time>
<time class="wallet-details__tx-time" ng-if="btx.time && !createdWithinPastDay(btx)">{{btx.time * 1000 | date:'MMMM d, y'}}</time>
<span translate class="text-warning"
ng-show="!btx.time && (!btx.confirmations || btx.confirmations == 0)">
Unconfirmed