GMT fix
authorDemeritCowboy <demeritcowboy@hotmail.com>
Tue, 1 Oct 2019 00:03:10 +0000 (20:03 -0400)
committerDemeritCowboy <demeritcowboy@hotmail.com>
Tue, 1 Oct 2019 00:03:10 +0000 (20:03 -0400)
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();