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

Not loading (solved) #18

Open
elyktc opened this issue Nov 5, 2018 · 2 comments
Open

Not loading (solved) #18

elyktc opened this issue Nov 5, 2018 · 2 comments

Comments

@elyktc
Copy link

elyktc commented Nov 5, 2018

Spent several hours figuring out why it would only show "Loading..."

Narrowed it down to this line:
https://github.com/jclarke0000/MMM-MyCommute/blob/master/MMM-MyCommute.js#L289

Turns out moment.duration(...).format is not a function. Not sure how/if this ever worked.

What you can do instead that is similar is use .humanize()
https://momentjs.com/docs/#/durations/humanize/

For example, replace the above line with the following:
timeEl.innerHTML = moment.duration(Number(timeInTraffic), "seconds").humanize();

Posting as an issue instead of a pull request since the owner seems to have abandoned this repo, and also because your solution may vary based on your preference.

Hope this saves someone else some time.

@dannytsang
Copy link

dannytsang commented Jul 17, 2019

Worked perfectly for me. Thank you

@sheldonjohnson1
Copy link

I know that this is a dead thread. but you fixed my issue too. what a life saver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants