Module: check_mk
Branch: master
Commit: 41b08180254d30dd3bc80936d23698eff738b70c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=41b08180254d30…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Oct 5 16:04:11 2014 +0200
New valuespec for selecting a time format
---
web/htdocs/valuespec.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index a06e48a..98019b3 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -2128,6 +2128,20 @@ def DateFormat(**args):
return DropdownChoice(**args)
+def TimeFormat(**args):
+ args.setdefault("title", _("Time format"))
+ args.setdefault("default_value", "%H:%M:%S")
+ args["choices"] = [
+ ("%H:%M:%S", "18:27:36"),
+ ("%l:%M:%S %p", "12:27:36 PM"),
+ ("%H:%M", "18:27"),
+ ("%l:%M %p", "6:27 PM"),
+ ("%H", "18"),
+ ("%l %p", "6 PM"),
+ ]
+ return DropdownChoice(**args)
+
+
# Make a configuration value optional, i.e. it may be None.
# The user has a checkbox for activating the option. Example: