From 97c5358631a42f56c1f3bf8ed9a014cc15a08d58 Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Thu, 10 Apr 2014 23:33:03 -0700 Subject: [PATCH] Add moment.suppressDeprecationWarnings --- moment.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 " + -- 2.47.2