Merge pull request #15483 from demeritcowboy/say-my-name-2
[civicrm-core.git] / tests / karma / unit / crmMailingRadioDateSpec.js
index 279f331bbe16218523fc52eddb5667b0c15e4633..0e47406b3e78563575ab85e364b36c61eb7d408c 100644 (file)
@@ -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();