ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilDclDatetimeRecordRepresentation.php
Go to the documentation of this file.
1 <?php
2 require_once('./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseRecordRepresentation.php');
3 
11 
19  public function getHTML($link = true) {
20  global $DIC;
21  $ilUser = $DIC['ilUser'];
22 
23  $value = $this->getRecordField()->getValue();
24  if ($value == '0000-00-00 00:00:00' OR !$value) {
25  return $this->lng->txt('no_date');
26  }
27  return $this->formatDate($value, $ilUser->getDateFormat());
28  }
29 
36  protected function formatDate($value, $format) {
37  $timestamp = strtotime($value);
38  switch($format)
39  {
41  return date("d.m.Y", $timestamp);
43  return date("Y-m-d", $timestamp);
45  return date("m/d/Y", $timestamp);
46  }
47  return $this->lng->txt('no_date');
48  }
49 
50 
58  public function parseFormInput($value) {
59  if (!$value || $value == "-") {
60  return NULL;
61  }
62  return substr($value, 0, - 9);
63  }
64 }
parseFormInput($value)
function parses stored value to the variable needed to fill into the form for editing.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
$ilUser
Definition: imgupload.php:18
getHTML($link=true)
Outputs html of a certain field.
Class ilDclBaseRecordRepresentation.
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
global $DIC
Class ilDclDateTimeRecordRepresentation.