From 474fa5fe19180ba702365bd3779939811083a851 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Sun, 28 Dec 2014 21:53:12 +0000 Subject: [PATCH] only validate expiry when both are set --- services/web/public/coffee/main/new-subscription.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/web/public/coffee/main/new-subscription.coffee b/services/web/public/coffee/main/new-subscription.coffee index a1d73c3912..4202308ce3 100644 --- a/services/web/public/coffee/main/new-subscription.coffee +++ b/services/web/public/coffee/main/new-subscription.coffee @@ -16,8 +16,8 @@ define [ $scope.data = number: "" - month: "" - year: "" + month: undefined + year: undefined cvv: "" first_name: "" last_name: "" @@ -60,7 +60,8 @@ define [ $scope.validation.correctCardNumber = recurly.validate.cardNumber($scope.data.number) $scope.validateExpiry = -> - $scope.validation.correctExpiry = recurly.validate.expiry($scope.data.month, $scope.data.year) + if $scope.data.month? and $scope.data.year? + $scope.validation.correctExpiry = recurly.validate.expiry($scope.data.month, $scope.data.year) $scope.validateCvv = -> $scope.validation.correctCvv = recurly.validate.cvv($scope.data.cvv)