srushti / goldberg

Goldberg is a lightweight CI server written in Ruby which worries about Bundler & RVM so that you don't have to.
Other
243 stars 29 forks source link

time of _projects.html.haml and builds.html.haml not necessarily in sync #144

Closed ghost closed 11 years ago

ghost commented 11 years ago

On my setup, the time displayed on the main page ("XX minutes ago", etc.) was correct, but the display on the build page of a certain project was 5h off. I checked the code, my machine's clocks, the timezones, etc... and couldn't find it. However, I noticed, that two different pieces of code are used to basically compute the same. So I did the following change to use the same code and get the clocks always in sync:

--- orangenschale.orig/app/views/layouts/builds.html.haml   2012-07-12 05:14:44.000000000 -0500
+++ orangenschale/app/views/layouts/builds.html.haml    2012-07-31 23:29:53.647866300 -0500
@@ -15,7 +15,7 @@
           - if build.revision
             %span.revision= revision_number_text(build)
           - if build.timestamp
-            %span.timeago(title="#{build.timestamp.iso8601}")
+            = format_timestamp(build.timestamp)
           %span.build-pointer

   .latest-build.clearfix= yield
srushti commented 11 years ago

Changed it the other way around. The timeago plugin should pick up the time from your browser, and should be more accurate.

ghost commented 11 years ago

Mh, this way round, the times are 5h off on my machine, and my local time is set correctly, etc.. Any idea?

ghost commented 11 years ago

nevermind, I guess my local version is missing a few other things as well... I will figure it out

srushti commented 11 years ago

Yeah, I'm not sure why this is not working for you. My server's running on UTC and that's how the time is being reported, and the relative timestamps work correctly on my timezone (IST) when I view it on my browser.