Типа я (zilogic) wrote in changelog,
Типа я
zilogic
changelog

[livejournal] r22306: LJSV-2169: Custom comment pages show com...

Committer: amyshkin
LJSV-2169: Custom comment pages show comments in UTC regardless of user time zone
U   trunk/cgi-bin/LJ/S2/EntryPage.pm
Modified: trunk/cgi-bin/LJ/S2/EntryPage.pm
===================================================================
--- trunk/cgi-bin/LJ/S2/EntryPage.pm	2012-06-22 09:12:42 UTC (rev 22305)
+++ trunk/cgi-bin/LJ/S2/EntryPage.pm	2012-06-22 09:43:58 UTC (rev 22306)
@@ -192,9 +192,9 @@
 
             # local time in mysql format to gmtime
             my $datetime = DateTime_unix($com->{'datepost_unix'});
-            my $datetime_remote = $tz_remote ? DateTime_tz($com->{'datepost_unix'}, $tz_remote) : undef;
+            my $datetime_remote = $tz_remote ? DateTime_tz($com->{'datepost_unix'}, $tz_remote) : $datetime;
             my $seconds_since_entry = $com->{'datepost_unix'} - $entry->logtime_unix;
-            my $datetime_poster = DateTime_tz($com->{'datepost_unix'}, $tz_remote);
+            my $datetime_poster = DateTime_tz($com->{'datepost_unix'}, $pu);
             my ($edited, $edit_url, $edittime, $edittime_remote, $edittime_poster);
 
             if ($com->{_loaded}) {
@@ -205,7 +205,7 @@
 
                 if ($edited) {
                     $edittime = DateTime_unix($comment->edit_time);
-                    $edittime_remote = $tz_remote ? DateTime_tz($comment->edit_time, $tz_remote) : undef;
+                    $edittime_remote = $tz_remote ? DateTime_tz($comment->edit_time, $tz_remote) : $edittime;
                     $edittime_poster = DateTime_tz($comment->edit_time, $pu);
                 }
             }
@@ -270,7 +270,7 @@
                 'talkid' => $dtalkid,
                 'text' => $text,
                 'userpic' => $comment_userpic,
-                'time' => $datetime_remote,
+                'time' => $datetime,
                 'system_time' => $datetime, # same as regular time for comments
                 'edittime' => $edittime_remote,
                 'tags' => [],
@@ -288,10 +288,10 @@
                 'dom_id' => "ljcmt$dtalkid",
                 'comment_posted' => $commentposted,
                 'edited' => $edited ? 1 : 0,
-                'time_remote' => $datetime_remote,
+                'time_remote' => $tz_remote ? $datetime_remote : undef,
                 'time_poster' => $datetime_poster,
                 'seconds_since_entry' => $seconds_since_entry,
-                'edittime_remote' => $edittime_remote,
+                'edittime_remote' => $tz_remote ? $edittime_remote : undef,
                 'edittime_poster' => $edittime_poster,
                 'edit_url' => $edit_url,
             };

Tags: amyshkin, livejournal, pm, zilogic
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments