You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.
I'm noticing when I first load a form with payments-format="expiry" that I'm getting an "Invalid Date" javascript error. I tracked it down to the function call for _getFormattedExpiry.
var _getFormattedExpiry = function(value) { if(value !== null) { var obj = Common.parseExpiry(value); var expiry = new Date(obj.year, obj.month-1); return $filter('date')(expiry, 'MM / yyyy'); } return null; };
The problem is that value being passed in is undefined, not null. I was able to fix the issue in my code by setting the ng-model value to null once I start the controller, but I wasn't sure if it'd be safer to check if null or undefined?
The text was updated successfully, but these errors were encountered:
This error appeared for me when I last time did a major update to packages in our project. Not sure which package had influence on revealing it, though.
I came up with the same workaround to this issue (initialising my model with null) and it works fine.
I'm noticing when I first load a form with payments-format="expiry" that I'm getting an "Invalid Date" javascript error. I tracked it down to the function call for _getFormattedExpiry.
var _getFormattedExpiry = function(value) { if(value !== null) { var obj = Common.parseExpiry(value); var expiry = new Date(obj.year, obj.month-1); return $filter('date')(expiry, 'MM / yyyy'); } return null; };
The problem is that
value
being passed in isundefined
, notnull
. I was able to fix the issue in my code by setting the ng-model value to null once I start the controller, but I wasn't sure if it'd be safer to check if null or undefined?The text was updated successfully, but these errors were encountered: