Dual_Clock block

Dual_Clock block

by Martin Mueller -
Number of replies: 10

Hi

I noticed so far that chats show their sheduled session(s) in the timezone of the server. And I thougt, it might be helpful for some people working with customers located in different timezones to display the current server time to those users.

Therefore, I created a so called dual_clock block. It displays the current server and local time. I'll try to add a screenshot after posting. See attached zip and the readme.txt inside.

Probably, this would better be done as an option of the calendar block. But since I'm very new to moodle, I don't want to hack around in foreign code.

OK, have fun and good luck.

Greetings from good old Switzerland - Martin

PS: Do not attempt to reach the server shown at the screenshot, sincs it is intranet.

Attachment dual_clock_v0.1.jpg
Average of ratings: -
In reply to Martin Mueller

Here's the file

by Martin Mueller -

OK, OK, uploading a new attachement will delete the old one. Good to know wink

Edit: Wanted to add that the time updates of course, if it's not a screenshot cool

In reply to Martin Mueller

Re: Here's the file

by Roberto Azar -

Hi !

I am very interested in your clock but I don't know WHAT to do in all the folders i download.... may i receive a step-by-step install help?

I have installed today a clock from this forum in my new moodle - only one week old -  but is gives the local time and i need GMT time, or the two....

Must i uninstall the actual clock to install yours ?

Thanks in advance for your help

Roberto Azar

http://eba-stats.com

http://eba-stats.com/moodle

In reply to Martin Mueller

And a question

by Martin Mueller -

Hmmmm... There is a question left: How do I have to modify the block in order to let teachers add them to resources (like chats? -> courses is not the prob.)

TIA - Martin

In reply to Martin Mueller

Re: And a question

by John Papaioannou -
First of all... the chat times (as all other times) should be displayed in the user's local time, provided that the user has chosen his timezone correctly in the user profile. If this doesn't work correctly for you, you may need to tweak your settings a bit.

Easiest way to modify the block to allow it to be added everywhere is to add this method:

function applicable_formats() {
    return array('all' => true);
}

You may also find this document helpful. wink
Average of ratings: Useful (1)
In reply to John Papaioannou

Re: And a question

by Martin Mueller -

Hi Jon

Tnx for your answer. Very nice & helpful document.

As for the timezone question: If you have a look at the screenshot, you will see what I mean. Do you think, that moodle.org should tweack its settings a bit? If yes, this was, what confused me. If no, this is a problem. From where should I as the stupid know where the server is located? On my intranet installation, it looks a little bit different. Here, the location is not "Server's local time", but "Europa/Zurich". This is a little bit more helpful, than "Server", but either, who the hell in let's say Sugarcreek, Ohio, has the timezone offset to Zurich available in its brain.

Perhaps, I miss to see the wood because of all the trees? wink

Martin

Attachment ss.jpg
In reply to Martin Mueller

Re: And a question

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Wood. Trees. Chopping blocks. smile

If you look in your profile you'll see you can set your timezone in there and everything will be printed in your local time. No need to know anything except perhaps a little local geography smile

I've also changed the default setting for Moodle.org from "server time" to "Australia/Perth". It's the same thing numerically but should be more descriptive in the cases when people have not set their own timezone (as in your screenshot).
In reply to Martin Dougiamas

Re: And a question

by Martin Mueller -

What a wonderful world

wink

Thanks a lot, Martin. Its hard work to find out all options and details of your software. Let's do it wink

Greetings from Switzerland - Martin

In reply to Martin Dougiamas

Re: And a question

by Martin Mueller -

Its me again. Sorry for penetration.

With your kind help, I was happy to see when the chat will araise. And I was there, but nobody else. So I thought immediately to a daylight savings time problem and found the appropriate discussion.

I think, the solusion, Jon, the Greek, proposed, sounds good. Are there any plans for this topic?

Greetings - Martin

Attachment dstprob.jpg