Module: check_mk
Branch: master
Commit: 953090378d6c24b2116d624a8f7da842ab3527bc
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=953090378d6c24…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Mar 27 08:24:51 2015 +0100
#2141 FIX Fix computation of explicit time ranges with time of day
When you entered an explicit time range (e.g. in the options for the
graph time range) and selected <i>Explicit time...</i> then 24 hours
would be added to the end time. This has been fixed. Note: the adding
of one day is still being done when selecting <i>Explicit date...</i>,
so that if you select the same start and end date the span is exactly
24 hours.
---
.werks/2141 | 15 +++++++++++++++
ChangeLog | 1 +
web/htdocs/valuespec.py | 4 +++-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.werks/2141 b/.werks/2141
new file mode 100644
index 0000000..26f7428
--- /dev/null
+++ b/.werks/2141
@@ -0,0 +1,15 @@
+Title: Fix computation of explicit time ranges with time of day
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1427440971
+
+When you entered an explicit time range (e.g. in the options for the
+graph time range) and selected <i>Explicit time...</i> then 24 hours
+would be added to the end time. This has been fixed. Note: the adding
+of one day is still being done when selecting <i>Explicit date...</i>,
+so that if you select the same start and end date the span is exactly
+24 hours.
diff --git a/ChangeLog b/ChangeLog
index f1bf387..d612ee4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -345,6 +345,7 @@
* 2150 FIX: Reworked internal logging mechanism...
* 1953 FIX: Fixed processing of html processing in input fields...
* 2157 FIX: LDAP: Fixed group-to-role/group-to-contactgroup sync with OpenLDAP (using posixGroup)
+ * 2141 FIX: Fix computation of explicit time ranges with time of day...
WATO:
* 1760 Added search form to manual checks page
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index f523626..70e58be 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -2205,11 +2205,13 @@ class Timerange(CascadingDropdown):
until_time = now
title = _("The last ") + Age().value_to_text(rangespec[1])
return (from_time, until_time), title
+
elif rangespec[0] in [ 'date', 'time' ]:
from_time, until_time = rangespec[1]
if from_time > until_time:
raise MKUserError("avo_rangespec_9_0_year", _("The end date must be after the start date"))
- until_time += 86400 # Consider *end* of this day
+ if rangespec[0] == 'date':
+ until_time += 86400 # Consider *end* of this day
title = AbsoluteDate().value_to_text(from_time) + " ... " + \
AbsoluteDate().value_to_text(until_time)
return (from_time, until_time), title