#405 Inventory reports default to all time to fix missing IPs

This commit is contained in:
Oliver Gorwits
2018-04-28 22:10:11 +01:00
parent 901c9d1180
commit c0fcc7f5d5
4 changed files with 15 additions and 3 deletions

View File

@@ -1,3 +1,9 @@
2.039027 - 2018-04-28
[BUG FIXES]
* #405 Inventory reports default to all time to fix missing IPs
2.039026 - 2018-04-28
[ENHANCEMENTS]

View File

@@ -193,12 +193,18 @@ Takes an interval in days, weeks, months, or years in a format like '7 days'
and returns a date range in the format 'YYYY-MM-DD to YYYY-MM-DD' by
subtracting the interval from the current date.
If C<$interval> is not passed, epoch zero (1970-01-01) is used as the start.
=cut
sub interval_to_daterange {
my $interval = shift;
return unless $interval =~ m/^(?:\d+)\s+(?:day|week|month|year)s?$/;
unless ($interval
and $interval =~ m/^(?:\d+)\s+(?:day|week|month|year)s?$/) {
return "1970-01-01 to " . Time::Piece->new->ymd;
}
my %const = (
day => ONE_DAY,

View File

@@ -22,7 +22,7 @@
<div class="clearfix">
<input class="nd_side-input" id="daterange" required="required"
type="text" name="daterange" value="[%
(params.exists('daterange') ? params.daterange : to_daterange('30 days')) | html_entity %]"/>
(params.exists('daterange') ? params.daterange : to_daterange()) | html_entity %]"/>
</div>
</fieldset>

View File

@@ -24,7 +24,7 @@
<div class="clearfix">
<input class="nd_side-input" id="daterange" required="required"
type="text" name="daterange" value="[%
(params.exists('daterange') ? params.daterange : to_daterange('30 days')) | html_entity %]"/>
(params.exists('daterange') ? params.daterange : to_daterange()) | html_entity %]"/>
</div>
</fieldset>