Doubles dates at the time-overview reports

Edwin Groothuis edwin at mavetju.org
Fri Nov 1 06:13:40 CET 2002


This patch will get rid of the double dates in for example the
email hourly overview:

                                 Hourly
                                 ------

  Deliveries Attempts By 1h Period

   2002-11-01 00:00 ......................................... 95
   2002-11-01 01:00 ......................................... 85
   2002-11-01 02:00 ........................................ 108
   2002-11-01 03:00 ......................................... 95
   2002-11-01 04:00 ......................................... 69
   2002-11-01 05:00 ......................................... 87
   2002-11-01 06:00 ......................................... 89
   2002-11-01 07:00 ........................................ 117
   2002-11-01 08:00 ........................................ 333
   2002-11-01 09:00 ........................................ 533
   2002-11-01 10:00 ........................................ 348
   2002-11-01 11:00 ........................................ 365
              12:00 ........................................ 274
              13:00 ......................................... 40
              14:00 ........................................ 736
              15:00 ........................................ 479


--- all/lib/Lire/AsciiDlf/Timegroup.pm	28 Oct 2002 01:23:23 -0000	1.38
+++ all/lib/Lire/AsciiDlf/Timegroup.pm	1 Nov 2002 05:05:56 -0000
@@ -474,9 +474,10 @@
 	    my $fmt = $self->{time_fmt};
 	    if ( $self->{period_sec} < 86400 ) { # 1d
 		# Make sure that date change are indicated
-		if ( $tslice->[0] >= $last_day + 86400 ) {
+		if ( $tslice->[0] -  $self->{tz_offset} >= $last_day + 86400 ) {
 		    $fmt = '%Y-%m-%d %H:%M';
-		    $last_day = $tslice->[0] - ($tslice->[0] % 86400)
+		    $last_day = $tslice->[0]
+		      - ( ( $tslice->[0] + $self->{tz_offset} ) % 86400)
 		      - $self->{tz_offset};
 		}
 	    }

  Deliveries Attempts By 1h Period

   2002-11-01 00:00 ......................................... 95
              01:00 ......................................... 85
              02:00 ........................................ 108
              03:00 ......................................... 95
              04:00 ......................................... 69
              05:00 ......................................... 87
              06:00 ......................................... 89
              07:00 ........................................ 117
              08:00 ........................................ 333

Edwin

-- 
Edwin Groothuis      |            Personal website: http://www.MavEtJu.org
edwin at mavetju.org    |    Weblog: http://www.mavetju.org/weblog/weblog.php 
bash$ :(){ :|:&};:   | Interested in MUDs? http://www.FatalDimensions.org/

-- 
To UNSUBSCRIBE, email to development-request at logreport.org with a subject of
"unsubscribe". Trouble? Send an email with subject "help" to
development-request at logreport.org



More information about the Development mailing list