[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 9b2247c07534fa9408eed1ec034aaeca299dbed2
Mark Wells
mark at 420.am
Thu Mar 22 12:23:00 PDT 2012
The branch, FREESIDE_2_3_BRANCH has been updated
via 9b2247c07534fa9408eed1ec034aaeca299dbed2 (commit)
from beb8de491440154f2dad96188c815d225b0edee8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9b2247c07534fa9408eed1ec034aaeca299dbed2
Author: Mark Wells <mark at freeside.biz>
Date: Thu Mar 22 12:13:35 2012 -0700
use date_format for daily report labels, #16533
diff --git a/FS/FS/Report/Table/Daily.pm b/FS/FS/Report/Table/Daily.pm
index 3b21fa8..6087b0d 100644
--- a/FS/FS/Report/Table/Daily.pm
+++ b/FS/FS/Report/Table/Daily.pm
@@ -3,7 +3,9 @@ package FS::Report::Table::Daily;
use strict;
use vars qw( @ISA );
use FS::Report::Table;
+use FS::Conf;
use Time::Local qw( timelocal );
+use Date::Format qw( time2str );
@ISA = qw( FS::Report::Table );
@@ -58,16 +60,15 @@ sub data {
my $sdate = timelocal(0,0,0,$sday,$smonth-1,$syear);
my $edate = timelocal(0,0,0,$eday,$emonth-1,$eyear);
+ my $conf = FS::Conf->new;
+ my $date_format = $conf->config('date_format') || '%d/%m/%Y';
+
#warn "daily range $sdate $edate\n";
# XXX: use date_format config for the labels since we have day in the labels now?
# XXX: leap seconds / DST
while ( $sdate < $edate ) {
- my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($sdate);
- $mon++;
- $year += 1900;
- #warn "label=$mday/$mon/$year\n";
- push @{$data{label}}, "$mday/$mon/$year";
+ push @{$data{label}}, time2str($date_format, $sdate);
my $speriod = $sdate;
$sdate += 86400;
-----------------------------------------------------------------------
Summary of changes:
FS/FS/Report/Table/Daily.pm | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
More information about the freeside-commits
mailing list