projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f691b3f
)
more accurate calculation of package start delays, #20686
author
Mark Wells
<mark@freeside.biz>
Thu, 19 Sep 2013 20:33:26 +0000
(13:33 -0700)
committer
Mark Wells
<mark@freeside.biz>
Thu, 19 Sep 2013 20:33:37 +0000
(13:33 -0700)
FS/FS/part_pkg.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg.pm
b/FS/FS/part_pkg.pm
index
3e63338
..
184f1cb
100644
(file)
--- a/
FS/FS/part_pkg.pm
+++ b/
FS/FS/part_pkg.pm
@@
-5,7
+5,8
@@
use strict;
use vars qw( %plans $DEBUG $setup_hack $skip_pkg_svc_hack );
use Carp qw(carp cluck confess);
use Scalar::Util qw( blessed );
use vars qw( %plans $DEBUG $setup_hack $skip_pkg_svc_hack );
use Carp qw(carp cluck confess);
use Scalar::Util qw( blessed );
-use Time::Local qw( timelocal timelocal_nocheck );
+use DateTime;
+use Time::Local qw( timelocal timelocal_nocheck ); # eventually replace with DateTime
use Tie::IxHash;
use FS::Conf;
use FS::Record qw( qsearch qsearchs dbh dbdef );
use Tie::IxHash;
use FS::Conf;
use FS::Record qw( qsearch qsearchs dbh dbdef );
@@
-1034,10
+1035,11
@@
sub delay_start_date {
my $self = shift;
my $delay = $self->delay_start or return '';
my $self = shift;
my $delay = $self->delay_start or return '';
-
- my ($mday,$mon,$year) = (localtime(time))[3,4,5];
- timelocal(0,0,0,$mday,$mon,$year) + 86400 * $delay;
+ # avoid timelocal silliness
+ my $dt = DateTime->today(time_zone => 'local');
+ $dt->add(days => $delay);
+ $dt->epoch;
}
sub freqs_href {
}
sub freqs_href {