Colors top-up icon green or pending.

This commit is contained in:
Andy Phillipson 2017-06-07 18:55:43 -04:00
commit 59edea271b
No known key found for this signature in database
GPG key ID: D813A67D567D6C88
7 changed files with 125 additions and 58 deletions

View file

@ -65,6 +65,7 @@ angular.module('copayApp.services').factory('bitpayCardService', function($log,
n.lastFourDigits = x.lastFourDigits;
n.token = x.token;
n.currency = x.currency;
n.country = x.country;
cards.push(n);
});

View file

@ -0,0 +1,30 @@
'use strict';
angular.module('copayApp.services').factory('timeService', function() {
var root = {};
root.withinSameMonth = function(time1, time2) {
if (!time1 || !time2) return false;
var date1 = new Date(time1 * 1000);
var date2 = new Date(time2 * 1000);
return getMonthYear(date1) === getMonthYear(date2);
}
root.withinPastDay = function(time) {
var now = new Date();
var date = new Date(time * 1000);
return (now.getTime() - date.getTime()) < (1000 * 60 * 60 * 24);
};
root.isDateInCurrentMonth = function(date) {
var now = new Date();
return getMonthYear(now) === getMonthYear(date);
};
root.getMonthYear = function(date) {
return date.getMonth() + date.getFullYear();
}
return root;
});