We might switch from using variables to a dedicated 'clock' table, but unsure about that.
See also #859216: WorldClock and Clock modules differences/similarities, where this was identified as being one of the show-stoppers for a merge.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iantresman’s picture

This could be useful. I would like to display:

Your time: Tue 23rd Nov 2010 ( 4:12 am)
My time:   Mon 22nd Nov 2010 (11:12 pm)
tstoeckler’s picture

I'm actually currently working on this.

Just a note, that this patch will be the start of the 7.x-2.x branch, which will be back-ported to a 6.x-2.x branch once this is done.

tstoeckler’s picture

Status: Active » Needs work

The DRUPAL-7--2 branch has recently seen some commits.

Multiple clocks are now basically working.
You can add as many clocks as you like and order them as you like.
I originally wanted to use some sort of modalframe/popup/etc for the add/edit/delete forms, but there doesn't seem to be any Drupal 7 module that does that currently.

In general, though, I like it a lot and I would love to hear from others what they think.

@#1: Currently it's not possible to include custom text in clocks. Maybe it makes sense to introduce a 'label' for each clock? I don't know. I'd like to get more feedback.

Smenzo’s picture

Please could you let me know how to add multiple clocks? I installed 7.x-2.x-dev today (I have no previous install of Clocks module) but I cannot see how to add multiple clocks. The block setting page only lets me choose one timezone in the 'Custom timezone' option.
If multiple clocks are displayed we would need to display the timezone of each clock otherwise users wont know what each clock represents.

tstoeckler’s picture

@Smenzo: Thanks for pointing that out. It seems that there was a problem with the 7.x-2.x development snapshot. I am pretty sure I have fixed it now, so please try out the new snapshot that appears in 12 hours. You can see if it worked, if the Date of the tarball says something in January 2011.

Smenzo’s picture

Thanks for fixing it, I've installed the latest dev and I needed the tables module too, which I have also installed.

In the block configuration page I can successfully add multiple clocks but the weight column is blank, the 'add a clock' grid does not look aligned very well and the drag and drop re-ordering of clocks doesn't work.

However the multiple clocks are successfully displayed in the block in the order I originally created them. All they need is a label to indicate what time zone each clock represents. I'm not sure if you want to track these items under this one issue or whether you would like them raised as separate bugs / issues.

tstoeckler’s picture

As this is really new development which is subject to change, I don't think it makes much sense to split them into multiple issues. It would be awesome if you could provide some screenshots of the problems you're having. The problems are probably related to the table module. There were some bugs in it so I am running a patched version locally, which is probably why I am not seeing those bugs. I will have to look into it in detail.

Great thanks for your feedback, though!

Smenzo’s picture

FileSize
16.1 KB

Screenshot of current issue organising multiple clocks for comment #6.

tstoeckler’s picture

@Smenzo: Thanks very much for the screenshot.
The issue is indeed with the table module.
I am currently working on moving the dependency from the Table module (http://drupal.org/project/table) to the Edge module (http://drupal.org/project/edge), which also provides a table element, and seems to work better. There are still some problems related to the drag-n-drop, as well as the 'Add clock' line, so that I'm not able to post a (working) patch or even commit anything now.
I'll see if I can provide patches to Edge that might get committed.

If this all gets sorted out, I'll report back and it would be awesome if you (@Smenzo) or @iantresman or anyone else could try it out again, then. So, stay tuned! :)

tstoeckler’s picture

Just a little status update for those adventurous souls wanting to try out the 7.x-2.x development version:
I've recently committed some code, to get token integration working, so that instead of just displaying the clock you can display arbitrary text in by entering the text in a new "Display" field and making use of tokens. E.g. if you enter
My clock: [clock:date]
The [clock:date] part will be replaced by the actual clock.
Other available tokens are [clock:time_zone] and [clock:date_type]. See also #1056178: Add translatable fields before and/or after each clock .

The whole module should basically work fine, except for one thing: The block configuration page. It depends on the table element, which isn't provided by Drupal core. Instead you need the module (not the Table module anymore), but that supports only very simple tables and not (yet) a little more complex table like this one. The drag-and-drop of clocks for instance is definitely broken. I will look into that and see whether a dependency on Edge actually makes sense or not. That will take some time, though, that I currently don't have.

Also, for the recent commits to work, I disabled JavaScript updating, so that is not going to work.

Also, if you had a development snapshot installed before you'll need to reinstall, otherwise you'll get this error: #1063150: Unknown column 'display' in SELECT cid, -snip- date_type, display, weight FROM {clock_settings} line 80 clock.module

Apart from that, though, everything should work and if you find errors, notices, etc. please report them right here in this issue. Even more importantly, if you have suggestions for the user interface, or general improvements those are very welcome (except for the block configuration page, which is, as noted above broken currently).

Thanks!

Tebb’s picture

Do you think it's worth putting the edge dependency on the project page for D7?

I managed to miss it and was using the table module which is marked as obsolete/abandoned and wasn't working very well with clock.

tstoeckler’s picture

@#11: I'm still a bit torn on that whole subject because even though Edge module's table implementation is much better than Table modules, there are still some bugs that make need to be hashed out. I'd like to wait for that before making any "official" notes on the project page.

electropop’s picture

@#1: Currently it's not possible to include custom text in clocks. Maybe it makes sense to introduce a 'label' for each clock? I don't know. I'd like to get more feedback.
..

That would be a very good feature !

tstoeckler’s picture

@electropop: With the current 7.x-2.x development version, you can enter a custom text for each clock and then display the clock wherever you want inside that text using the [clock:date] token. That seems to me a little bit more generalized and configurable than simply a label.
It might be a bit buggy still, but it would be awesome if you could try it out and report back. You will need the Token module and the Edge module.

electropop’s picture

Tank you tstoeckler. I will it try soon.

tstoeckler’s picture

Status: Needs work » Fixed
FileSize
274 bytes

I've decided to mark this issue fixed. There are probably still problems with the current code, but please open separate issues for anything you notice.
To prevent confusion I've committed the attached patch, which introduces a dependency on Edge module. I don't know if that is what we will end up with in the end, but it represents the current state of the code.

tstoeckler’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.