ng-idle icon indicating copy to clipboard operation
ng-idle copied to clipboard

ngidle breaks if you overload the dates tojson

Open werpu opened this issue 8 years ago • 0 comments

The problem is you store the date as text objects instead of simply storing the getTime() values in the local storage, so if something overloads the toJson to format the json string into a certain date format, you might break the parsing after the loading of the expiry date from the local storage.

This happened to us in one case on chrome, the fix is simply to use getTime at the time the date is stored in the local storage and then restore it again with the existing code. The date might not be humanly readable anymore in the storage but it works.

werpu avatar Dec 01 '16 09:12 werpu