Add credit card expiration date to the billing info screen
This commit is contained in:
parent
f4c488f9b6
commit
a9a8105fbc
4 changed files with 30 additions and 1 deletions
|
@ -3293,6 +3293,13 @@ quayApp.directive('billingOptions', function () {
|
|||
PlanService.unregisterListener(this);
|
||||
});
|
||||
|
||||
$scope.isExpiringSoon = function(cardInfo) {
|
||||
var current = new Date();
|
||||
var expires = new Date(cardInfo.exp_year, cardInfo.exp_month, 1);
|
||||
var difference = expires - current;
|
||||
return difference < (60 * 60 * 24 * 60 * 1000 /* 60 days */);
|
||||
};
|
||||
|
||||
$scope.changeCard = function() {
|
||||
var previousCard = $scope.currentCard;
|
||||
$scope.changingCard = true;
|
||||
|
|
Reference in a new issue