Problem with momentjs

Hello,

I have problem with momentjs to get 2 clocks working at the same time.
Here is the link to the problem : https://github.com/moment/moment/issues/3281

Best regards.

somebody please ?

I tried to solve the issue, but there are a lot of problems with what I’m using. What is your error exactly? Which error are you getting in the console?

Here are the libraries I used:

<script src="https://cdn.jsdelivr.net/momentjs/2.10.6/moment-with-locales.min.js"></script>
<script src="https://cdn.jsdelivr.net/momentjs/2.10.6/locales.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.4/moment-timezone.min.js"></script>
<script src="https://code.jquery.com/jquery-2.2.4.js"></script>

If you’re using different versions, you can find them here: https://cdnjs.com/

Well i Have copied the code for their clock and tried to use 2 Different timezones.
But it shows 1timezone for Both clocks.
You can check it out at http://shormex.com

This doesn’t help me. I need to see your code. Please post it to JSBin or JSFiddle in the same way it’s broken for you.

My bad here is the link to fiddle.
One clock needs amsterdam timezone and the other clock has timezone from curacao.

You were setting var now = moment() instead of moment with the TZ offset: var now = moment().tz(timezone)

This looks like what you’re after: https://jsfiddle.net/qwbg5chh/1/

edit: Sorry. I had my own Timezones in the last one. This is back to the ones you want https://jsfiddle.net/qwbg5chh/2/

I feel so dumb now.
Thanks for helping I appreciate it.
Now I can make my client happy again !

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.