Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed momentjs deprecation warning. Closes #47. #48

Merged
merged 3 commits into from Aug 17, 2015

Conversation

@arb
Copy link
Contributor

arb commented Aug 12, 2015

Changes moment construction to avoid moment deprecation warning.

@arb arb assigned geek Aug 12, 2015
@arb arb added this to the 5.0.3 milestone Aug 12, 2015
@@ -102,7 +102,7 @@ internals.GoodConsole.prototype.init = function (stream, emitter, callback) {

internals.GoodConsole.prototype._printEvent = function (event) {

var m = Moment.utc(event.timestamp);
var m = Moment(new Date(parseInt(event.timestamp, 10)));

This comment has been minimized.

Copy link
@geek

geek Aug 13, 2015

Member

why not create like:

var m = Moment(event.timestamp);

This comment has been minimized.

Copy link
@arb

arb Aug 13, 2015

Author Contributor

Incase event.timestamp is a string. Then you'll get the deprecation warning which is what this is supposed to fix.

This comment has been minimized.

Copy link
@geek

geek Aug 13, 2015

Member

I see that now... but you don't need to make it a Date

var m = Moment(parseInt(event.timestamp, 10));

This comment has been minimized.

Copy link
@arb

arb Aug 14, 2015

Author Contributor

You got me! PR updated.

@geek geek added the bug label Aug 17, 2015
geek added a commit that referenced this pull request Aug 17, 2015
Fixed momentjs deprecation warning. Closes #47.
@geek geek merged commit 28db2a5 into hapijs:master Aug 17, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@arb arb deleted the arb:moment-js-cleanup branch Aug 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.