]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Random thing failing around DST
authorIskren Chernev <iskren.chernev@gmail.com>
Tue, 1 Nov 2016 13:58:49 +0000 (13:58 +0000)
committerIskren Chernev <iskren.chernev@gmail.com>
Sun, 6 Nov 2016 08:48:45 +0000 (01:48 -0700)
src/test/moment/relative_time.js

index 6b0c4a5253d88c5b172d406e0eea9185970442e3..adb9652a13f82258fdb8372dfbb847b24ade3c22 100644 (file)
@@ -151,23 +151,23 @@ test('custom rounding', function (assert) {
     moment.relativeTimeThreshold('d', 31);
     moment.relativeTimeThreshold('M', 12);
 
-    var a = moment();
+    var a = moment.utc();
     a.subtract({minutes: 59, seconds: 59});
     assert.equal(a.toNow(), 'in 59 minutes', 'Round down towards the nearest minute');
 
-    a = moment();
+    a = moment.utc();
     a.subtract({hours: 23, minutes: 59, seconds: 59});
     assert.equal(a.toNow(), 'in 23 hours', 'Round down towards the nearest hour');
 
-    a = moment();
+    a = moment.utc();
     a.subtract({days: 30, hours: 23, minutes: 59});
     assert.equal(a.toNow(), 'in 30 days', 'Round down towards the nearest day');
 
-    a = moment();
+    a = moment.utc();
     a.subtract({days: 364});
     assert.equal(a.toNow(), 'in 11 months', 'Round down towards the nearest month');
 
-    a = moment();
+    a = moment.utc();
     a.subtract({years: 1, days: 364});
     assert.equal(a.toNow(), 'in a year', 'Round down towards the nearest year');
 
@@ -177,7 +177,7 @@ test('custom rounding', function (assert) {
     };
     moment.relativeTimeRounding(retainValue);
 
-    a = moment();
+    a = moment.utc();
     a.subtract({hours: 39});
     assert.equal(a.toNow(), 'in 1.625 days', 'Round down towards the nearest year');