Html::showDateTimeFormItem PHP Method

showDateTimeFormItem() static public method

Display DateTime form with calendar
static public showDateTimeFormItem ( $element, $value = '', $time_step, $maybeempty = true, $can_edit = true, $minDate = '', $maxDate = '', $minTime = '', $maxTime = '' ) : rand
$element name of the element
$value default value to display (default '')
$time_step step for time in minute (-1 use default config) (default -1)
$maybeempty may be empty ? (true by default)
$can_edit could not modify element (true by default)
$minDate minimum allowed date (default '')
$maxDate maximum allowed date (default '')
$minTime minimum allowed time (default '')
$maxTime maximum allowed time (default '')
return rand value used \deprecated since 0.84 used Html::showDateTimeField instead
    static function showDateTimeFormItem($element, $value = '', $time_step = -1, $maybeempty = true, $can_edit = true, $minDate = '', $maxDate = '', $minTime = '', $maxTime = '')
    {
        return self::showDateTimeField($element, array('value' => $value, 'timestep' => $time_step, 'maybeempty' => $maybeempty, 'canedit' => $can_edit, 'mindate' => $minDate, 'maxdate' => $maxDate, 'mintime' => $minTime, 'maxtime' => $maxTime));
    }

Usage Example

Example #1
0
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
$AJAX_INCLUDE = 1;
include '../inc/includes.php';
// Send UTF8 Headers
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
Session::checkLoginUser();
if (isset($_POST['value']) && strcmp($_POST['value'], '0') == 0) {
    if ($_POST['withtime']) {
        Html::showDateTimeFormItem($_POST['name'], $_POST['specificvalue']);
    } else {
        Html::showDateFormItem($_POST['name'], $_POST['specificvalue']);
    }
} else {
    echo "<input type='hidden' name='" . $_POST['name'] . "' value='" . $_POST['value'] . "'>";
}
All Usage Examples Of Html::showDateTimeFormItem
Html