I recently installed this module and it seems to work fine. I am displaying the format of Day of Week, Date, Time (hrs & min only). However, if I turn on the option to "Update the clock continuously via JavaScript", the time suddenly changes to 5 hours earlier than it is. If I turn off the option, the time reverts to the correct time.

I have the Time Zone Setting set to Site Time Zone. I have the latest jQuery timers library and am running Drupal 6.14.

Not a critical issue obviously, just a puzzling one. Any thoughts?

Thanks.

CommentFileSizeAuthor
#6 clock-time-js.patch4.74 KBtstoeckler

Comments

tstoeckler’s picture

Category: support » bug

Hmm... now that's weird. I just checked the demo site and it happens there too. Only that the difference between the times is 1 hour, and not 5 hours.
I will hopefully look into this tonight, otherwise on the weekend.

Thanks a lot for reporting that issue!

bill_redman’s picture

I don't know if this is of any help and it may just be a coincidence, but I'm in the Eastern time zone of the United States which happens to be 5 hours behind Greenwich Mean Time (UTC).
I tried your demo site this morning and when I turned that option on, the time changed to 5 hours earlier there as well.

tovstiadi’s picture

same here, starts with correct time, jumps back five hours (from EST to UTC)
running Drupal 6.16, latest versions of Clock, jquery.timers 1.2, Mac OS X Server 10.6.2

tstoeckler’s picture

Priority: Normal » Critical

http://drupal.org/cvs?commit=351722
A little fix for the Local time which didn't seem to be working without JS. Discovered that while debugging this.
I thought it would be a quick fix, but it seems there is something wrong in the very core of the JS-date handling.
Just a note, that this is pretty high on my list, but it will take more than just a half-hour squeezed in between something else, so I don't when I will can get back to it. I will release a new version, though, as soon as this is fixed.

tstoeckler’s picture

Component: Code » JavaScript
Status: Active » Needs review

This fixed it for me.
It moves the passing of the date from PHP to JS from the not very transparent timestamp method to usage of a proper time string.
It also allowed to remove a very strange hacky thing from the JS file, which lets me sleep better in general.
I committed the attached patch (http://drupal.org/cvs?commit=352870) to CVS.
Please try it out by pulling the code from CVS or, when the next 6.x-1.x-dev release is packaged in max. 12 hours, by downloading the 6.x-1.x-dev tarball. If the issue is fixed for you, then I guess we can consider this fixed.

tstoeckler’s picture

StatusFileSize
new4.74 KB

Ooops, forgot the patch.

Status: Needs review » Needs work

The last submitted patch, clock-time-js.patch, failed testing.

tstoeckler’s picture

Status: Needs work » Fixed

Due to the lack of feedback and the need to get this out, because this module seems to be critically broken at the moment and due to http://drupal.org/node/771240#comment-2868482 I'm marking this as fixed. Please reopen, if the current 6.x-1.x-dev version does not fix the problem.
Will roll out a new version in the next few days otherwise.

bill_redman’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Component: JavaScript » Miscellaneous
Category: bug » support
Priority: Critical » Normal
Status: Fixed » Active

Haven't been able to check if all is well now because even though I have the Clock and Libraries modules installed, no Clock block is shown in admin/build/block. Anyone have any suggestions? Thanks...

tstoeckler’s picture

Component: Miscellaneous » JavaScript
Category: support » bug
Status: Active » Postponed (maintainer needs more info)

Thanks for the report BillRedman.
I just noticed that the 6.x-1.x-dev release of Clock was corrupted. It was packaging the wrong branch from CVS. I have corrected that now. Please try the snapshot that appears in 12 hours and see if that fixes this. You can also pull the DRUPAL-6--1 branch from CVS directly.
You couldn't find the Clock block, because the version was implementing the D7 hooks not the D6 hooks. Everything *should* be fixed, though.

tstoeckler’s picture

Damn, CVS tripped me again...
I just noticed that the tarball wouldn't update, because there was no new commit. I just did a commit to that branch, so in 12 hours the tarball should update and should be usable for testing (for real this time!). Thanks, again.

rob c’s picture

Installed 1.1 couple hours ago, same problem, i am in Amsterdam, when i put the site on UTC (2 hours) the time jumps from for example 8am to 9am when my local time is 10am.
Only happens when i use the javascript as described in @1 by Bill.

Updated to the -dev = FIXED. Time now stays at the selected time.

Great ts :) time for a new release? :D

(- no clean install of -dev tested, updating seems to work, block shows up at blocks, can edit it, so seems okay.)
(- i get a nice 'notice' of the libraries api, also installed it, seems to work, can edit / save the block)

tstoeckler’s picture

Status: Postponed (maintainer needs more info) » Fixed

I really want to release 1.2. I acutally wanted to already a few days ago, but testing it locally I found a small bug using the (newly added) Local time zone. I have planned to look at that this weekend and then release.
Thanks for commenting here, though, AllRob. I hadn't had any feedback to the fix. Also good thing to have a feedback that the 'soft' Libraries API integration is not freaking people out.

Marking fixed for now. But feel free to re-open, if you are having issues in the dev version.

tstoeckler’s picture

For reference: I created #792432: Local time not working

Status: Fixed » Closed (fixed)

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