我越來越Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.
但我是新手我無法弄清楚如何解決它,以便上述消息消失。 我認爲問題在於這兩條線,但我不確定。瞬間JS:棄用警告:時刻施工回落到js日期。這是沮喪,將在即將到來的主要版本中刪除
var nextMonth = moment(moment(year + "-" + month + "-1")).add(1, "months").format("MM");
var nextYear = moment(moment(year + "-" + month + "-1")).add(1, "months").format("YYYY");
我已經檢查https://github.com/moment/moment/issues/1407和Deprecation warning: moment construction falls back to js Date但也似乎對我的問題的工作。
我想知道在這個計算中,我應該告訴格式,或者至少如何以正確的格式進行計算,這樣警告消失。
提前致謝!
參考http://stackoverflow.com/questions/23263380/deprecation-warning-moment-construction-falls-back-to-js-date – murli2308