From 3960c23ba8e4d6cbb2d2cfd2d38f6abc39315b43 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Tue, 24 Jul 2012 20:34:26 -0400 Subject: [PATCH] Fix date. --- static/js/potd.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); }