X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fkarma%2Funit%2FcrmMailingRadioDateSpec.js;h=0e47406b3e78563575ab85e364b36c61eb7d408c;hb=0d193d5d82ad563f88169bf925484734bd65bcbc;hp=279f331bbe16218523fc52eddb5667b0c15e4633;hpb=7ba9f1d2c4dcd13fa8fe542728cd152eff860c0f;p=civicrm-core.git diff --git a/tests/karma/unit/crmMailingRadioDateSpec.js b/tests/karma/unit/crmMailingRadioDateSpec.js index 279f331bbe..0e47406b3e 100644 --- a/tests/karma/unit/crmMailingRadioDateSpec.js +++ b/tests/karma/unit/crmMailingRadioDateSpec.js @@ -107,7 +107,10 @@ describe('crmMailingRadioDate', function() { var datenow = [year, month, day].join('-'); var time = [hours, minutes, "00"].join(':'); var currentDate = datenow + ' ' + time; - var ndate = new Date(datenow); + // Using datenow in the constructor here converts to local time. If not + // running on GMT (or east) then comparison to toDateString below fails. + // Also use month-1 because...javascript. + var ndate = new Date(year, month-1, day, 0, 0, 0); model.the_date = currentDate; $rootScope.$digest();