JS Clock - Time Rendering Incorrectly inside Webflow

Hey!

I’m looking for some support getting this analog clock working.

On my site trying to display a clock for each office location, showing the local time.
I’ve managed to customize this Codepen and everything is working great in the pen:

However, when setting everything up with the exact same content in Webflow the times are displaying incorrectly.

Read Only link:
https://preview.webflow.com/preview/clock-example?utm_medium=preview_link&utm_source=designer&utm_content=clock-example&preview=f0dfb7d310307f16fde7f638cf426e9c&workflow=preview

Published site:
https://clock-example.webflow.io/

Does anyone have any suggested edits to resolve this issue?

My JS is super limited.

hi @jamesgreeny here is short video with explanation why is not working the way you have set it up and how to apply simple fix to make it work.

https://cln.sh/zPXwML

1 Like

Hi @jamesgreeny was my response helpful to make it work or do you need further help?

Following. Im in need of creating 3 clocks showing 3 different world time. (Stockholm, Bejing and NYC). I’ve managed to set up the clock but i’m having a hard time getting the script to work…

@Stan A little tutorial on how to get this working would be much appreciated, if you have time!

Read only link: https://preview.webflow.com/preview/lt-nordic-new?utm_medium=preview_link&utm_source=designer&utm_content=lt-nordic-new&preview=32e367e1f58bcb7c90869edc041675a9&workflow=preview

Published site: https://lt-nordic-new.webflow.io/

Atle

Hi @Nosleep I will look onto if I will have time over this weekend.

1 Like

Much appreciated! Thanks alot.

Hi @Nosleepafter after first quick look I have found you do not have set custom attribute for each city that is referenced in script.

When you set it up it should work

but I can’t test it.

Aah perfect, i’ll set these parameters first thing tomorrow and how it goes.

Med vennlig hilsen

Atle Røisland
Designer
+47 958 83 339

nosleeptillbrooklyn.no

NOSLEEPTILLBROOKLYN
Østerveien 6
4631 Kristiansand
Norway

*** Edit: Ive got it to work now. Thanks for helping out!

Good morning @Stan. Or at least its morning here. I’ve made some changes to the code, as you pointed out. But i’m still struggling to get the dials to work. I would appreciate if you would have another look! :slight_smile:

Thanks in advance,
Atle

Hi @Nosleep I see you have make it work.