From: Iskren Chernev Date: Fri, 11 Apr 2014 06:33:03 +0000 (-0700) Subject: Add moment.suppressDeprecationWarnings X-Git-Tag: 2.6.0~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97c5358631a42f56c1f3bf8ed9a014cc15a08d58;p=thirdparty%2Fmoment.git Add moment.suppressDeprecationWarnings --- diff --git a/moment.js b/moment.js index 0d45e33e2..a068955db 100644 --- a/moment.js +++ b/moment.js @@ -303,7 +303,8 @@ function deprecate(msg, fn) { var firstTime = true; function printMsg() { - if (typeof console !== 'undefined' && console.warn) { + if (moment.suppressDeprecationWarnings === false && + typeof console !== 'undefined' && console.warn) { console.warn("Deprecation warning: " + msg); } } @@ -1629,6 +1630,8 @@ return makeMoment(c); }; + moment.suppressDeprecationWarnings = false; + moment.createFromInputFallback = deprecate( "moment construction falls back to js Date. This is " + "discouraged and will be removed in upcoming major " +