diff --git a/static/js/potd.js b/static/js/potd.js index 02d5bb0..0fd4786 100644 --- a/static/js/potd.js +++ b/static/js/potd.js @@ -74,8 +74,12 @@ function parse_file_url(data, filename) { set_background(url, descurl, imgwidth, imgheight); var data = {"url": url, "descurl": descurl, "imgwidth": imgwidth, "imgheight": imgheight}; - var now = new Date(); - var expires = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() + 1); + var expires = new Date(); + expires.setUTCMilliseconds(0); + expires.setUTCSeconds(0); + expires.setUTCMinutes(0); + expires.setUTCHours(0); + expires.setUTCDate(expires.getUTCDate() + 1); set_cookie_with_date("EarwigBackgroundCache", JSON.stringify(data), expires); }