Commit c12e6eced4b8a5be0c8ffa9946ce7d4f8cb0e159

Authored by Marius Hanne
1 parent 8e5ceb3acf
Exists in master

(hopefully) fix javascript time zone wreckage

Showing 2 changed files with 3 additions and 3 deletions Side-by-side Diff

app/views/fucking_time/index.html.haml
... ... @@ -28,7 +28,7 @@
28 28 %li= link_to "/WHOIS", "/WHOIS"
29 29 - #%li= link_to "/BUGS"
30 30  
31   - = javascript_tag "var tstamp = #{@time.to_i - @time.utc_offset};"
  31 + = javascript_tag "var tstamp = #{@time.to_i + @time.utc_offset};"
32 32 = javascript_tag "var time_format = '#{@opts[:time_format]}';"
33 33 = javascript_tag "var counter = 0;"
public/javascripts/application.js
1 1 function update_time() {
2   - time = new Date((tstamp - (new Date().getTimezoneOffset() * 60) + counter) * 1000);
  2 + time = new Date((tstamp + (new Date().getTimezoneOffset() * 60) + counter) * 1000);
3 3 $('time').update(time.strftime(time_format));
4 4 counter++;
5 5 setTimeout(function() { update_time() }, 1000);