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 +}])