]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Runt grunt tests for jbrockmeyer's comit for Issue 1715 1716/head
authorSam Vincent <sam_vincent@acl.com>
Mon, 16 Jun 2014 23:41:00 +0000 (16:41 -0700)
committerSam Vincent <sam_vincent@acl.com>
Mon, 16 Jun 2014 23:41:00 +0000 (16:41 -0700)
moment.js
test/moment/relative_time.js

index 83282c6fdbab67e9362c6e7f0421333f5a000090..06cd1d9951c7ab5c92d5d45f0670ce19d7ce5815 100644 (file)
--- a/moment.js
+++ b/moment.js
       if (relativeTimeThresholds[threshold] === undefined) {
         return false;
       }
+
+      if(limit  === undefined){
+        return relativeTimeThresholds[threshold];
+      }
+
       relativeTimeThresholds[threshold] = limit;
       return true;
     };
index 3a39d46f3709964c258eb9666e1cb61b0ac9929e..6e00f5b5bfdb28856d9fa9edc2993e26358db6ca 100644 (file)
@@ -111,6 +111,16 @@ exports.relativeTime = {
         a.subtract('days', 1);
         test.equal(a.fromNow(), "a year ago", "Above custom days to years threshold");
         moment.relativeTimeThreshold('dy', 345);
+        test.done();
+    },
+
+    "retrive threshold settings" : function (test) {
+        test.expect(1);
+        moment.relativeTimeThreshold('m', 45);
+        var minuteThreshold = moment.relativeTimeThreshold('m');
+
+        test.equal(minuteThreshold, 45, "Can retrieve minute setting");
+
         test.done();
     }
 };