Browse Source

The date picker fills the "time" part of the field with 00:00:00 when picking a DateTime instead of just a Date.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1911 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 13 years ago
parent
commit
f9fd4db574
2 changed files with 12 additions and 1 deletions
  1. 3 1
      application/cmdbabstract.class.inc.php
  2. 9 0
      application/itopwebpage.class.inc.php

+ 3 - 1
application/cmdbabstract.class.inc.php

@@ -1354,6 +1354,7 @@ EOF
 			{
 				$oObj = $aObjects[$sAlias];
 				foreach($aList[$sAlias] as $sAttCode => $oAttDef)
+
 				{
 					if (is_null($oObj))
 					{
@@ -1699,7 +1700,7 @@ EOF
 				$aEventsList[] ='validate';
 				$aEventsList[] ='keyup';
 				$aEventsList[] ='change';
-				$sHTMLValue = "<input title=\"$sHelpText\" class=\"date-pick\" type=\"text\" size=\"20\" name=\"attr_{$sFieldPrefix}{$sAttCode}{$sNameSuffix}\" value=\"".htmlentities($sDisplayValue, ENT_QUOTES, 'UTF-8')."\" id=\"$iId\"/>&nbsp;{$sValidationField}";
+				$sHTMLValue = "<input title=\"$sHelpText\" class=\"datetime-pick\" type=\"text\" size=\"20\" name=\"attr_{$sFieldPrefix}{$sAttCode}{$sNameSuffix}\" value=\"".htmlentities($sDisplayValue, ENT_QUOTES, 'UTF-8')."\" id=\"$iId\"/>&nbsp;{$sValidationField}";
 				break;
 
 				case 'Duration':
@@ -1735,6 +1736,7 @@ EOF
 					$aStyles = array();
 					$sStyle = '';
 					$sWidth = $oAttDef->GetWidth('width', '');
+
 					if (!empty($sWidth))
 					{
 						$aStyles[] = 'width:'.$sWidth;

+ 9 - 0
application/itopwebpage.class.inc.php

@@ -317,6 +317,15 @@ EOF
 			changeMonth: true,
 			changeYear: true
 		});
+		$(".datetime-pick").datepicker({
+			showOn: 'button',
+			buttonImage: '../images/calendar.png',
+			buttonImageOnly: true,
+			dateFormat: 'yy-mm-dd 00:00:00',
+			constrainInput: false,
+			changeMonth: true,
+			changeYear: true
+		});
 	// Restore the persisted sortable order, for all sortable lists... if any
 	$('.sortable').each(function()
 	{