mark the current month as recent
This commit is contained in:
parent
e41b46b42d
commit
19554b94b6
2 changed files with 20 additions and 5 deletions
|
|
@ -153,7 +153,8 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.getDate = function(txCreated) {
|
$scope.getDate = function(txCreated) {
|
||||||
return new Date(txCreated * 1000);
|
var date = new Date(txCreated * 1000);
|
||||||
|
return date;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.showGroupHeader = function(index) {
|
$scope.showGroupHeader = function(index) {
|
||||||
|
|
@ -168,9 +169,16 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
||||||
function createdDuringSameMonth(tx1, tx2) {
|
function createdDuringSameMonth(tx1, tx2) {
|
||||||
var date1 = new Date(tx1.time * 1000);
|
var date1 = new Date(tx1.time * 1000);
|
||||||
var date2 = new Date(tx2.time * 1000);
|
var date2 = new Date(tx2.time * 1000);
|
||||||
var date1MonthYear = date1.getMonth() + date1.getFullYear();
|
return getMonthYear(date1) === getMonthYear(date2);
|
||||||
var date2MonthYear = date2.getMonth() + date2.getFullYear();
|
}
|
||||||
return date1MonthYear === date2MonthYear;
|
|
||||||
|
$scope.isDateInCurrentMonth = function(date) {
|
||||||
|
var now = new Date();
|
||||||
|
return getMonthYear(now) === getMonthYear(date);
|
||||||
|
};
|
||||||
|
|
||||||
|
function getMonthYear(date) {
|
||||||
|
return date.getMonth() + date.getFullYear();
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.showMore = function() {
|
$scope.showMore = function() {
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,14 @@
|
||||||
|
|
||||||
<div class="wallet-details__list" ng-show="txHistory[0]">
|
<div class="wallet-details__list" ng-show="txHistory[0]">
|
||||||
<div ng-repeat="btx in txHistory track by $index" ng-click="openTxModal(btx)">
|
<div ng-repeat="btx in txHistory track by $index" ng-click="openTxModal(btx)">
|
||||||
<div class="wallet-details__group-label" ng-if="showGroupHeader($index)">{{getDate(btx.time) | date:'MMMM'}}</div>
|
<div class="wallet-details__group-label" ng-if="showGroupHeader($index)">
|
||||||
|
<span ng-if="isDateInCurrentMonth(getDate(btx.time))">
|
||||||
|
Recent
|
||||||
|
</span>
|
||||||
|
<span ng-if="!isDateInCurrentMonth(getDate(btx.time))">
|
||||||
|
{{getDate(btx.time) | date:'MMMM'}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="wallet-details__item">
|
<div class="wallet-details__item">
|
||||||
<img class="wallet-details__tx-icon" src="img/icon-tx-received.svg" width="40" ng-if="btx.action == 'received'">
|
<img class="wallet-details__tx-icon" src="img/icon-tx-received.svg" width="40" ng-if="btx.action == 'received'">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue