switch day diff calculation to epoch based so that "N hours short of M days" becomes... master
Matt S Trout [Sat, 29 Aug 2009 17:50:54 +0000 (18:50 +0100)]
lib/IronMunger/Calculate.pm

index 43b7fe0..236953f 100644 (file)
@@ -16,7 +16,10 @@ use Sub::Exporter -setup => {
 sub day_diff ($dt1, $dt2) {
   $dt1 = $dt1->at if $dt1->isa('IronMunger::Post');
   $dt2 = $dt2->at if $dt2->isa('IronMunger::Post');
-  $dt1->delta_days($dt2)->delta_days;
+  my $seconds = $dt2->epoch - $dt1->epoch;
+  $seconds = -$seconds if $seconds < 0;
+  int($seconds / 86400);
+  #$dt1->delta_days($dt2)->delta_days;
 }
 
 sub check_post_gap ($aperture, $days, @posts) {