mirror of https://github.com/BTCPrivate/copay.git
Fixed layout, relative time. Standardize on use of timeService.
This commit is contained in:
parent
59edea271b
commit
ae777d6639
|
@ -163,7 +163,7 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
||||||
runningBalance -= parseFloat(tx.amount);
|
runningBalance -= parseFloat(tx.amount);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.withinPastDay = function(tx) {
|
$scope.createdWithinPastDay = function(tx) {
|
||||||
var result = false;
|
var result = false;
|
||||||
if (tx.timestamp) {
|
if (tx.timestamp) {
|
||||||
result = timeService.withinPastDay(tx.timestamp);
|
result = timeService.withinPastDay(tx.timestamp);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('proposalsController',
|
angular.module('copayApp.controllers').controller('proposalsController',
|
||||||
function($timeout, $scope, profileService, $log, txpModalService, addressbookService) {
|
function($timeout, $scope, profileService, $log, txpModalService, addressbookService, timeService) {
|
||||||
|
|
||||||
$scope.fetchingProposals = true;
|
$scope.fetchingProposals = true;
|
||||||
|
|
||||||
|
@ -27,8 +27,6 @@ angular.module('copayApp.controllers').controller('proposalsController',
|
||||||
$scope.openTxpModal = txpModalService.open;
|
$scope.openTxpModal = txpModalService.open;
|
||||||
|
|
||||||
$scope.createdWithinPastDay = function(time) {
|
$scope.createdWithinPastDay = function(time) {
|
||||||
var now = new Date();
|
return timeService.withinPastDay(time);
|
||||||
var date = new Date(time * 1000);
|
|
||||||
return (now.getTime() - date.getTime()) < (1000 * 60 * 60 * 24);
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -131,9 +131,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.createdWithinPastDay = function(time) {
|
$scope.createdWithinPastDay = function(time) {
|
||||||
var now = new Date();
|
return timeService.withinPastDay(time);
|
||||||
var date = new Date(time * 1000);
|
|
||||||
return (now.getTime() - date.getTime()) < (1000 * 60 * 60 * 24);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.openExternalLink = function() {
|
$scope.openExternalLink = function() {
|
||||||
|
|
|
@ -201,7 +201,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.createdDuringSameMonth = function(curTx, prevTx) {
|
$scope.createdDuringSameMonth = function(curTx, prevTx) {
|
||||||
return timeService.withinSameMonth(curTx.time, prevTx.time);
|
return timeService.withinSameMonth(curTx.time * 1000, prevTx.time * 1000);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.createdWithinPastDay = function(time) {
|
$scope.createdWithinPastDay = function(time) {
|
||||||
|
|
|
@ -5,20 +5,20 @@ angular.module('copayApp.services').factory('timeService', function() {
|
||||||
|
|
||||||
root.withinSameMonth = function(time1, time2) {
|
root.withinSameMonth = function(time1, time2) {
|
||||||
if (!time1 || !time2) return false;
|
if (!time1 || !time2) return false;
|
||||||
var date1 = new Date(time1 * 1000);
|
var date1 = new Date(time1);
|
||||||
var date2 = new Date(time2 * 1000);
|
var date2 = new Date(time2);
|
||||||
return getMonthYear(date1) === getMonthYear(date2);
|
return root.getMonthYear(date1) === root.getMonthYear(date2);
|
||||||
}
|
}
|
||||||
|
|
||||||
root.withinPastDay = function(time) {
|
root.withinPastDay = function(time) {
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
var date = new Date(time * 1000);
|
var date = new Date(time);
|
||||||
return (now.getTime() - date.getTime()) < (1000 * 60 * 60 * 24);
|
return (now.getTime() - date.getTime()) < (1000 * 60 * 60 * 24);
|
||||||
};
|
};
|
||||||
|
|
||||||
root.isDateInCurrentMonth = function(date) {
|
root.isDateInCurrentMonth = function(date) {
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
return getMonthYear(now) === getMonthYear(date);
|
return root.getMonthYear(now) === root.getMonthYear(date);
|
||||||
};
|
};
|
||||||
|
|
||||||
root.getMonthYear = function(date) {
|
root.getMonthYear = function(date) {
|
||||||
|
|
|
@ -70,6 +70,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.item {
|
.item {
|
||||||
|
border-color: $item-border-color;
|
||||||
|
&.activity-header {
|
||||||
|
z-index: 3;
|
||||||
|
border: 0;
|
||||||
|
border-bottom: 1px solid #EFEFEF;
|
||||||
|
}
|
||||||
|
&.activity {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
@ -86,7 +93,10 @@
|
||||||
stroke: $v-bitcoin-orange;
|
stroke: $v-bitcoin-orange;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.tx-icon {
|
.tx-icon {
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
float: left;
|
float: left;
|
||||||
margin-right: 25px;
|
margin-right: 25px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
<a ng-click="bitpayCard.openExternalLink('https://help.bitpay.com/bitpay-card/why-was-i-overcharged-on-my-bitpay-card-account-why-is-there-a-hold-on-my-account')" translate>Learn More</a>
|
<a ng-click="bitpayCard.openExternalLink('https://help.bitpay.com/bitpay-card/why-was-i-overcharged-on-my-bitpay-card-account-why-is-there-a-hold-on-my-account')" translate>Learn More</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="list" ng-show="!bitpayCard.getStarted">
|
<div class="list" ng-show="!bitpayCard.getStarted">
|
||||||
<label class="item item-input item-select">
|
<label class="item item-input item-select activity-header">
|
||||||
<div class="input-label" translate>
|
<div class="input-label" translate>
|
||||||
Activity
|
Activity
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="item" ng-class="{'sent': tx.price.toString().indexOf('-') > -1 && !tx.pending, 'receive': tx.price.toString().indexOf('-') == -1 && !tx.pending, 'pending': tx.pending}">
|
<div class="item activity" ng-class="{'sent': tx.price.toString().indexOf('-') > -1 && !tx.pending, 'receive': tx.price.toString().indexOf('-') == -1 && !tx.pending, 'pending': tx.pending}">
|
||||||
<img class="tx-icon svg" ng-src="img/mcc-icons/{{tx.icon}}.svg" width="40">
|
<img class="tx-icon svg" ng-src="img/mcc-icons/{{tx.icon}}.svg">
|
||||||
<div class="tx-content">
|
<div class="tx-content">
|
||||||
<div class="tx-title">
|
<div class="tx-title">
|
||||||
<div class="ellipsis">
|
<div class="ellipsis">
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<div>
|
<div>
|
||||||
<time class="wallet-details__tx-time" ng-if="tx.createdOn && createdWithinPastDay(tx.createdOn)">{{tx.createdOn * 1000 | amTimeAgo}}</time>
|
<time class="wallet-details__tx-time" ng-if="tx.createdOn && createdWithinPastDay(tx.createdOn * 1000)">{{tx.createdOn * 1000 | amTimeAgo}}</time>
|
||||||
<time class="wallet-details__tx-time" ng-if="tx.createdOn && !createdWithinPastDay(tx.createdOn)">{{tx.createdOn * 1000 | date:'MMMM d, y'}}</time>
|
<time class="wallet-details__tx-time" ng-if="tx.createdOn && !createdWithinPastDay(tx.createdOn * 1000)">{{tx.createdOn * 1000 | date:'MMMM d, y'}}</time>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -64,8 +64,8 @@
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<div>
|
<div>
|
||||||
<time class="wallet-details__tx-time" ng-if="btx.time && createdWithinPastDay(btx.time)">{{btx.time * 1000 | amTimeAgo}}</time>
|
<time class="wallet-details__tx-time" ng-if="btx.time && createdWithinPastDay(btx.time * 1000)">{{btx.time * 1000 | amTimeAgo}}</time>
|
||||||
<time class="wallet-details__tx-time" ng-if="btx.time && !createdWithinPastDay(btx.time)">
|
<time class="wallet-details__tx-time" ng-if="btx.time && !createdWithinPastDay(btx.time * 1000)">
|
||||||
{{btx.time * 1000 | amDateFormat:'MMM D, YYYY'}}
|
{{btx.time * 1000 | amDateFormat:'MMM D, YYYY'}}
|
||||||
</time>
|
</time>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue