Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At least in current FireFox (66.0.3) the date calculation is broken
and leads for 26th April 2019 + 365 days to Wed Jun 06 2091 (72 years in the future).
See the following date calculation approaches with results:
var exdate = new Date();
exdate.setTime(exdate.getTime() + ((expiryDays || 365) * 24 * 60 * 60 * 1000));
console.log('exdate1 ' + exdate);
var exdate2 = new Date();
exdate2.setHours(exdate2.getHours() + ((expiryDays || 365) * 24));
console.log('exdate2 ' + exdate2);
var exdate3 = new Date();
exdate3.setDate(exdate3.getDate() + (expiryDays || 365));
console.log('exdate3 ' + exdate3);
exdate1 Sat Apr 25 2020 13:24:07 GMT+0200 (Central European Summer Time)
exdate2 Sat Apr 25 2020 13:24:07 GMT+0200 (Central European Summer Time)
exdate3 Wed Jun 06 2091 13:24:07 GMT+0200 (Central European Summer Time)