diff --git a/application/views/helpers/FormDateTime.php b/application/views/helpers/FormDateTime.php
index 70a0ff211..80dce56b3 100644
--- a/application/views/helpers/FormDateTime.php
+++ b/application/views/helpers/FormDateTime.php
@@ -53,7 +53,6 @@ class Zend_View_Helper_FormDateTime extends Zend_View_Helper_FormElement
$jspicker = (isset($attribs['jspicker']) && $attribs['jspicker'] === true) ? true : false;
- // Do we have a value?
if (isset($value) && !empty($value)) {
if ($jspicker) {
$value = ' value="' . $this->view->dateFormat()->format($value, $attribs['defaultFormat']) . '"';
@@ -65,8 +64,9 @@ class Zend_View_Helper_FormDateTime extends Zend_View_Helper_FormElement
}
// Build the element
- $xhtml = '
'
- . '';
+
+ $xhtml .= 'getClosingBracket()
- . '
';
+ $xhtml .= $this->getClosingBracket();
+
+ if ($jspicker === true) {
+ $xhtml .= ''
+ . ''
+ . ''
+ . ''
+ . '';
+ }
+
+ $xhtml .= '';
return $xhtml;
}
diff --git a/library/Icinga/Web/Form/Element/DateTimePicker.php b/library/Icinga/Web/Form/Element/DateTimePicker.php
index 4ef97b5ab..33e6e7951 100644
--- a/library/Icinga/Web/Form/Element/DateTimePicker.php
+++ b/library/Icinga/Web/Form/Element/DateTimePicker.php
@@ -42,7 +42,7 @@ use \Icinga\Util\DateTimeFactory;
class DateTimePicker extends Zend_Form_Element_Text
{
/**
- * Defautl format used my js picker
+ * Default format used my js picker
*
* @var string
*/
diff --git a/public/css/icinga/main.less b/public/css/icinga/main.less
index 9551a4e36..a00dfd73a 100644
--- a/public/css/icinga/main.less
+++ b/public/css/icinga/main.less
@@ -115,6 +115,37 @@ p {
margin-bottom: 15px;
}
+/* =========================================================================
+ Bootstrap overrides
+ ========================================================================= */
+
+.input-group-addon {
+ padding: 4px 12px;
+}
+
+.glyphicon-arrow-right {
+ background: transparent url("@{baseurl}/img/icons/next.png") center center no-repeat;
+ display: inline-block;
+ width: 16px;
+ height: 16px;
+ text-indent: -999px;
+}
+
+.glyphicon-arrow-right:before {
+
+}
+
+.glyphicon-arrow-left {
+ background: transparent url("@{baseurl}/img/icons/prev.png") center center no-repeat;
+ display: inline-block;
+ width: 16px;
+ height: 16px;
+ text-indent: -999px;
+}
+.glyphicon-arrow-left:before {
+
+}
+
/* =========================================================================
Icinga Logo
========================================================================= */
diff --git a/public/js/icinga/components/datetime.js b/public/js/icinga/components/datetime.js
index 9ab81d38d..5dd06380d 100644
--- a/public/js/icinga/components/datetime.js
+++ b/public/js/icinga/components/datetime.js
@@ -40,6 +40,11 @@ define(['jquery', 'datetimepicker'], function($) {
todayBtn: true,
todayHighlight: true
});
+
+ $(target).parent().find('a').click(function(e) {
+ e.preventDefault();
+ $(target).datetimepicker('show');
+ });
};
return DateTimePicker;