Moment - Depreciation Warnings
Warnings are displayed for using moment in global namespace as well as moment.zone even though zone is not loaded.
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.js"></script>
JavaScript
$(function () {
var initDate = function (arrears) {
return {
startDate: moment().subtract(arrears, 'days').format('YYYY-MM-DD'),
endDate: moment().subtract(arrears, 'days').format('YYYY-MM-DD')
};
};
console.log(initDate(6));
});
/* JSFIDDLE is not producing the warnings as seen on local. Expected Results:
- Deprecation warning: Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.
- Deprecation warning: moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779.
*/