From 420d606312b2e79ed175c8ec61c0a3a44771053e Mon Sep 17 00:00:00 2001 From: dlee Date: Wed, 30 Mar 2016 20:05:47 +0800 Subject: [PATCH] fix invalid date bug --- src/common.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common.js b/src/common.js index a486efc..f5f071b 100644 --- a/src/common.js +++ b/src/common.js @@ -9,6 +9,11 @@ angular.module('angularPayments') ret['parseExpiry'] = function(value){ var month, prefix, year, _ref; + if (value instanceof Date && value.getTime() !== value.getTime()) { + // Invalid Date + value = ''; + } + value = value || '' value = value.replace(/\s/g, ''); @@ -31,4 +36,4 @@ angular.module('angularPayments') return ret; -}]) \ No newline at end of file +}])