# HG changeset patch # User Myk Melez # Date 1224200258 25200 # Node ID 3a8dfaf1ac311568f25ae44f111040cd2119af76 # Parent 8ef75b54e3dd96ef7c97099b1e4185f3a5fa5cc7 correctly calculate the date representing tomorrow diff -r 8ef75b54e3dd -r 3a8dfaf1ac31 modules/utils.js --- a/modules/utils.js Wed Oct 15 16:40:35 2008 -0700 +++ b/modules/utils.js Thu Oct 16 16:37:38 2008 -0700 @@ -88,7 +88,10 @@ // these calculations to be incorrect at times. get tomorrow() { - let sometimeTomorrow = new Date(new Date() + (1000 * 60 * 60 * 24)); + // We can't just add the right number of milliseconds to new Date() here + // because JavaScript will interpret the plus sign as string concatenation, + // so we have to explicitly call getTime() on the date object. + let sometimeTomorrow = new Date(new Date().getTime() + (1000 * 60 * 60 * 24)); return new Date(sometimeTomorrow.getFullYear(), sometimeTomorrow.getMonth(), sometimeTomorrow.getDate());