]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Deprecate moment().min/max
authorIskren Chernev <iskren.chernev@gmail.com>
Thu, 1 May 2014 17:13:21 +0000 (10:13 -0700)
committerIskren Chernev <iskren.chernev@gmail.com>
Thu, 1 May 2014 17:13:21 +0000 (10:13 -0700)
moment.js

index 257ee7ec1a545e1115658e445008f78f364807c3..0c6da73234d227efa31382e55b5b1ac144a5a175 100644 (file)
--- a/moment.js
+++ b/moment.js
             return +this.clone().startOf(units) === +makeAs(input, this).startOf(units);
         },
 
-        min: function (other) {
-            other = moment.apply(null, arguments);
-            return other < this ? this : other;
-        },
-
-        max: function (other) {
-            other = moment.apply(null, arguments);
-            return other > this ? this : other;
-        },
+        min: deprecate(
+                 "moment().min is deprecated, use moment.min instead",
+                 function (other) {
+                     other = moment.apply(null, arguments);
+                     return other < this ? this : other;
+                 }
+         ),
+
+        max: deprecated(
+                "moment().max is deprecated, use moment.max instead",
+                function (other) {
+                    other = moment.apply(null, arguments);
+                    return other > this ? this : other;
+                }
+        ),
 
         // keepTime = true means only change the timezone, without affecting
         // the local hour. So 5:31:26 +0300 --[zone(2, true)]--> 5:31:26 +0200