Where you have this:
Quote:
expireDate.setDate(expireDate.getDate() + parseInt(Expire));
|
Change to:
Quote:
expireDate.setMinutes(expireDate.getMinutes() + parseInt(Expire));
|
And then change the initialization at the top to var stagedPopFrequency = "10 minutes";
You do not need to say days or minutes or anything in there actually, the script is only using the integer part.
The code is also using toGMTString which is deprecated and should be changed to toUTCString
This is still not a wonderful solution in my mind because now it is hardcoded for minutes instead of days as it was before.
If you truly wanted this to use the passed in value 1 days, 1 hours, 1 minutes,.... where you could set it however you wanted on the fly it would take some additional work.
.