On a multilingual site I need to display the clock block with multiple clocks something like this:

            World Times

Head Office 02/09/2011 - 12:39
Your Time   02/09/2011 - 17:39 Change
London      02/09/2011 - 12:39
Peking      02/09/2011 - 20:39
New York    02/09/2011 - 07:39

Where 'Change' is a link to edit the logged in user's timezone on their user account.

The text 'Your time', can shown in bold. (or possibly the whole line including the date/time and trailing text/link)

Ideally I would like to be able to translate these fields, but that's less important initially.

Happy to test any patches/releases.

Thanks for considering this request.

Comments

tstoeckler’s picture

Status:Active» Postponed

See #937134: Support multiple clocks for the ability to display multiple clocks.
Once that issue is done, we'll have to figure out how to support adding custom text to the list of clocks.
It seems to be a common feature request, and understandably I think, but I'm not quite sure how exactly is the best way. More specifically, I am not sure whether a field before and after each clock fits everyone's needs or if there are other use-cases we are missing.

Anyways, postponed on #937134: Support multiple clocks.

Tebb’s picture

Thanks Tobias.

Yes, I have the multiple clocks version installed and it does display multiple clocks with (as far as I have seen) the correct times for user/site/custom clocks. That's great to see, but I am not using it on my site because the clocks are not labelled and so are relatively meaningless.

I think many people's needs would be supported by pre- and post- text fields. Maybe I am a bit blinkered? What else did you have in mind?

tstoeckler’s picture

What I thought of, was to have a textfield for each clock, where the admin can enter the text to display. The display of the clock would be handled with token integration.
For instance you would enter:
Head office: [clock]
and get:
Head office: 02/09/2011 - 12:39

I think that could be useful for two reasons in addition to allowing users to enter text before and after a clock.
1. Other available tokens. In your example you maybe would do:
My time: [clock] <a href="user/[user:uid]/edit">Change</a>
2. More clock-related tokens. For instance:
[clock:time_zone]: [clock] [clock:time_zone:dst_marker]
would result in:
America/New York: 12:32 pm *

Thoughts?

Tebb’s picture

Yes, I like your idea, but it sounds like a lot of work? Lots of work = lots of time?

I don't understand the inner workings of Tokens, just how to use them.

Within the configuration of the clock block, the [clock] token would represent a different clock on each 'line'. This feels a bit different to the normal use of tokens with nodes.

Would it be difficult to implement?

Also, my main site is multilingual, so I'm wondering if this is more or less translatable than the text fields option for things like 'My Time' and 'Change'.

tstoeckler’s picture

Well, we first have to get the multiple clocks patch finished and comitted. I don't think it would be too much work, since Token is in core in D7.

Considering the multilingual capabilities: That's a general Drupal problem, that multilingual blocks are a problem.

Within the configuration of the clock block, the [clock] token would represent a different clock on each 'line'. This feels a bit different to the normal use of tokens with nodes.

I don't understand what you mean by that.

That said, let's get the other issue done first.

tstoeckler’s picture

Status:Postponed» Closed (duplicate)

I just committed some code to get token integration working.
You can check it out if you wait for the new development snapshot of the 7.x-2.x version.
Beware, though, this is highly -dev material.
You'll need to reinstall because the Schema has changed.
Also, you'll no longer need the Table module, but the Edge module instead.

I'm going to mark this issue duplicate of the other one for now, since this is all still in flux, and a bunch of things have to figured out.

tstoeckler’s picture

Just to be sure: I marked this duplicate of this issue: #937134: Support multiple clocks