madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r21982: LJSUP-12237: Incorrect time when edit Sc...

Committer: sbelyaev
LJSUP-12237: Incorrect time when edit Scheduled Entries
U   trunk/cgi-bin/LJ/DelayedEntry.pm
U   trunk/htdocs/editjournal.bml
Modified: trunk/cgi-bin/LJ/DelayedEntry.pm
===================================================================
--- trunk/cgi-bin/LJ/DelayedEntry.pm	2012-05-17 11:40:00 UTC (rev 21981)
+++ trunk/cgi-bin/LJ/DelayedEntry.pm	2012-05-17 11:40:45 UTC (rev 21982)
@@ -330,6 +330,7 @@
     if (!$remote) {
         return 0;
     }
+
     return $remote->prop("timezone");
 }
 
@@ -361,12 +362,17 @@
 }
 
 sub posttime {
-    my ($self, $u) = @_;
+    my ($self, $use_original_timezone) = @_;
     my $posttime = $self->system_posttime;
     my $timezone = $self->timezone;
+
+    if ($use_original_timezone) {
+        $timezone = $self->post_timezone;
+    }
     if (!$timezone) {
         return $posttime;
     }
+
     my $epoch = $self->posttime_as_unixtime;
     my $dt = DateTime->from_epoch( 'epoch' => $epoch );
     $dt->set_time_zone( $timezone );
@@ -390,8 +396,9 @@
 }
 
 sub alldatepart {
-    my ($self, $style) = @_;
-    my $mysql_time = $self->posttime;
+    my ($self, $style, $use_original_timezone) = @_;
+
+    my $mysql_time = $self->posttime($use_original_timezone);
     if ( ($style && $style eq 'S1') || $self->{default_dateformat} eq 'S1') {
         return LJ::TimeUtil::->alldatepart_s1($mysql_time);
     }

Modified: trunk/htdocs/editjournal.bml
===================================================================
--- trunk/htdocs/editjournal.bml	2012-05-17 11:40:00 UTC (rev 21981)
+++ trunk/htdocs/editjournal.bml	2012-05-17 11:40:45 UTC (rev 21982)
@@ -112,11 +112,11 @@
                 my $entry = LJ::DelayedEntry->get_entry_by_id($u, $ditem);
                 
                 push @ordered, {
-                                'alldatepart' => $entry->alldatepart ,
+                                'alldatepart' => $entry->alldatepart('default', 1) ,
                                 'system_alldatepart' => $entry->system_alldatepart,
                                 'allowmask'   => $entry->allowmask,
                                 'posterid'    => $entry->posterid,
-                                'eventtime'   => $entry->posttime,
+                                'eventtime'   => $entry->posttime(1),
                                 'security'    => $entry->security,
                                 'logtime'     => $entry->logtime,
                                 'delayed_obj' => $entry,
@@ -278,7 +278,7 @@
                 $res{'events_1_event'} = $entry_obj->event;
                 $res{'events_1_allowmask'} = $entry_obj->allowmask;
                 $res{'events_1_security'} = $entry_obj->security;            
-                $res{'events_1_eventtime'} = $entry_obj->posttime;
+                $res{'events_1_eventtime'} = $entry_obj->posttime(1);
                 $res{'events_1_'} = $entry_obj->prop("current_mood");
                 $res{'events_1_itemid'} = 0; # has no itemid
                 $res{'events_1_anum'} = 0;# has no anum

Tags: bml, livejournal, madeon, pm, sbelyaev
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