Digital clock for Service Portal

salomesimpsone
Giga Contributor

Hi All,

In Service Portal, we have "Cool clock" widget to display Analog Clock.

Did anyone tried on creating "Digital clock", according to different time zone??

Please help me to know....Thanks

1 ACCEPTED SOLUTION

rgm276
Mega Guru

so if all you want is a really simple digital clock, you can just add some code like the following to your clock widget, or create a clone of the clock widget


since the clock widget already creates a variable called c.date we can just use that to display our clock



HTML


<p id="time">


      {{c.date.hours()}}:{{c.date.minutes()}}:{{c.date.seconds()}}


  </p>


 


CSS


#time {


  font-family: fantasy;


  font-size:20px;


  color:silver;


  border:2px solid #2E9AFE;


  padding:10px;


  text-align: center;


  width: 200px;


}



Results in this output for the clock


find_real_file.png



you can make the clock look/feel prettier by adjusting the CSS to meet your needs


hope that helps


View solution in original post

18 REPLIES 18

rgm276
Mega Guru

you can set the time zone as an option in the widget alone with title as part of the OOB cool clock widget


CTRL-RIGHT-CLICK on the mouse to set the instance option for the clock


find_real_file.pngfind_real_file.png



however,


if you are wanting the clock to show up in the correct time zone of the user, you can simply clone the clock and add a couple of lines



find_real_file.png


Hi Robert,



Thanks for your reply



I have already created Analog clock(cool clock) for different Time Zones



find_real_file.png


But I need to display the time in Digital Format(digital clock)



could you please help??/


added to above...



What I need is, to show digital time(digital clock) according to different time zones


Hello Salome,



Could you share how to make the cool clock display different time zone and put it all together in one widget?



Thanks.