ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilDclDatetimeRecordRepresentation Class Reference

Class ilDclDateTimeRecordRepresentation. More...

+ Inheritance diagram for ilDclDatetimeRecordRepresentation:
+ Collaboration diagram for ilDclDatetimeRecordRepresentation:

Public Member Functions

 getHTML ($link=true)
 Outputs html of a certain field. More...
 
 parseFormInput ($value)
 function parses stored value to the variable needed to fill into the form for editing. More...
 
- Public Member Functions inherited from ilDclBaseRecordRepresentation
 __construct (ilDclBaseRecordFieldModel $record_field)
 
 getFormGUI (ilPropertyFormGUI $formGUI)
 
 parseFormInput ($value)
 function parses stored value to the variable needed to fill into the form for editing. More...
 
 fillFormInput ($form)
 Fills the form with the value of a record. More...
 
 getHTML ($link=true)
 Outputs html of a certain field. More...
 
 getSingleHTML (array $options=null, $link=true)
 Returns data for single record view. More...
 
 getConfirmationHTML ()
 Returns data for confirmation list When returning false, attribute is ignored in list. More...
 
 fillRow (ilTemplate $tpl)
 Fills row with record data. More...
 
 getRecordField ()
 Get Record Field. More...
 
 getField ()
 Getter shortcut for field. More...
 
 getRecord ()
 Getter shortcut for record. More...
 

Protected Member Functions

 formatDate ($value, $format)
 
- Protected Member Functions inherited from ilDclBaseRecordRepresentation
 getFormInput ()
 Gets the value from from the record field. More...
 

Additional Inherited Members

- Protected Attributes inherited from ilDclBaseRecordRepresentation
 $record_field
 
 $lng
 
 $access
 
 $ctrl
 

Detailed Description

Class ilDclDateTimeRecordRepresentation.

Author
Michael Herren mh@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0.0

Definition at line 10 of file class.ilDclDatetimeRecordRepresentation.php.

Member Function Documentation

◆ formatDate()

ilDclDatetimeRecordRepresentation::formatDate (   $value,
  $format 
)
protected
Parameters
$value
$format
Returns
false|string

Definition at line 36 of file class.ilDclDatetimeRecordRepresentation.php.

References $timestamp, date, ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, and ilCalendarSettings\DATE_FORMAT_YMD.

Referenced by getHTML().

36  {
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  }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
+ Here is the caller graph for this function:

◆ getHTML()

ilDclDatetimeRecordRepresentation::getHTML (   $link = true)

Outputs html of a certain field.

Parameters
mixed$value
bool | true$link
Returns
string

Definition at line 19 of file class.ilDclDatetimeRecordRepresentation.php.

References $DIC, $ilUser, formatDate(), and ilDclBaseRecordRepresentation\getRecordField().

19  {
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  }
$ilUser
Definition: imgupload.php:18
global $DIC
+ Here is the call graph for this function:

◆ parseFormInput()

ilDclDatetimeRecordRepresentation::parseFormInput (   $value)

function parses stored value to the variable needed to fill into the form for editing.

Parameters
$value
Returns
mixed

Definition at line 58 of file class.ilDclDatetimeRecordRepresentation.php.

58  {
59  if (!$value || $value == "-") {
60  return NULL;
61  }
62  return substr($value, 0, - 9);
63  }

The documentation for this class was generated from the following file: