moment deprecation warning possibly originating from moment-recur
See original GitHub issueI’m not 100% sure, but, I believe this line (moment-recur.js:737):
return moment.tz(this.format('YYYY-MM-DD'), 'UTC');
Is causing this warning:
Deprecation warning: value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
I think you want to do this:
return moment.tz(this.format('YYYY-MM-DDT00:00:00.000Z'), 'UTC');
or
return moment.tz(this.format('YYYY-MM-DD'), 'YYYY-MM-DD');
Issue Analytics
- State:
- Created 7 years ago
- Reactions:12
- Comments:5 (4 by maintainers)
Top Results From Across the Web
“Deprecation warning: moment construction falls back to js ...
When constructing a moment object with date not in these formats, the deprecation warning is thrown. Though the deprecation warnings are thrown, for...
Read more >Be careful when falling back to Date constructor · Issue #1407
Deprecation warning : moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release.
Read more >Deprecation warning: moment construction falls back to js Date.
I was looking on the site for some pointers, but can;t seem to find any reference to this library any more. ->getFormatter( 'Format::datetime', ......
Read more >Guides - Moment.js
There are several places where Moment.js displays deprecation warnings about functionality that will be removed in the future. Work-arounds are outlined here.
Read more >Moment.js documentation - DevDocs
Note: In 2.4.0, the globally exported moment object was deprecated. ... specify noGlobal then the globally exported moment will print a deprecation warning....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I submitted a PR - if someone wants to avoid this issue until PR is accepted,
npm install --save niftylettuce/moment-recur
.@niftylettuce done. Thanks for the contribution.