#405 Inventory reports default to all time to fix missing IPs
This commit is contained in:
6
Changes
6
Changes
@@ -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
|
2.039026 - 2018-04-28
|
||||||
|
|
||||||
[ENHANCEMENTS]
|
[ENHANCEMENTS]
|
||||||
|
|||||||
@@ -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
|
and returns a date range in the format 'YYYY-MM-DD to YYYY-MM-DD' by
|
||||||
subtracting the interval from the current date.
|
subtracting the interval from the current date.
|
||||||
|
|
||||||
|
If C<$interval> is not passed, epoch zero (1970-01-01) is used as the start.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub interval_to_daterange {
|
sub interval_to_daterange {
|
||||||
my $interval = shift;
|
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 = (
|
my %const = (
|
||||||
day => ONE_DAY,
|
day => ONE_DAY,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
<input class="nd_side-input" id="daterange" required="required"
|
<input class="nd_side-input" id="daterange" required="required"
|
||||||
type="text" name="daterange" value="[%
|
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>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
<input class="nd_side-input" id="daterange" required="required"
|
<input class="nd_side-input" id="daterange" required="required"
|
||||||
type="text" name="daterange" value="[%
|
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>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user