Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r17396: LJSUP-6780 (Twitter Digest): checkpoint ...

Committer: ailyin
LJSUP-6780 (Twitter Digest): checkpoint commit
U   trunk/cgi-bin/LJ/TimeUtil.pm
U   trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/LJ/TimeUtil.pm
===================================================================
--- trunk/cgi-bin/LJ/TimeUtil.pm	2010-09-16 11:03:36 UTC (rev 17395)
+++ trunk/cgi-bin/LJ/TimeUtil.pm	2010-09-16 13:04:49 UTC (rev 17396)
@@ -1,6 +1,8 @@
 package LJ::TimeUtil;
 use strict;
 
+use DateTime;
+
 # <LJFUNC>
 # name: LJ::TimeUtil->days_in_month
 # class: time
@@ -336,4 +338,19 @@
     die "unknown precision $precision";
 }
 
+sub next_afternoon {
+    my ($class, $tz, $after) = @_;
+
+    $after ||= time;
+
+    my $dt = DateTime->from_epoch('epoch' => $after, 'time_zone' => $tz);
+    $dt->set( 'hour'    => 12,
+              'minute'  => 0,
+              'second'  => 0 );
+
+    my $epoch = $dt->epoch;
+
+    return ($epoch > $after ? $epoch : $epoch + 86400);
+}
+
 1;

Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2010-09-16 11:03:36 UTC (rev 17395)
+++ trunk/cgi-bin/LJ/User.pm	2010-09-16 13:04:49 UTC (rev 17396)
@@ -1884,7 +1884,7 @@
     return 0 unless LJ::set_userprop($u, $prop, $value);  # FIXME: use exceptions
     $u->{$prop} = $value;
 
-    LJ::run_hook("props_changed", $u, {$prop => $value});
+    LJ::run_hooks("props_changed", $u, {$prop => $value});
 
     return $value;
 }

Tags: andy, livejournal, pm
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