ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 9 of file class.ilDclDatetimeRecordRepresentation.php.

Member Function Documentation

◆ formatDate()

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

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

38 {
39 $timestamp = strtotime($value);
40 switch ($format) {
42 return date("d.m.Y", $timestamp);
44 return date("Y-m-d", $timestamp);
46 return date("m/d/Y", $timestamp);
47 }
48 return $this->lng->txt('no_date');
49 }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
$format
Definition: metadata.php:141

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

Referenced by getHTML().

+ 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

Reimplemented from ilDclBaseRecordRepresentation.

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

20 {
21 global $DIC;
22 $ilUser = $DIC['ilUser'];
23
24 $value = $this->getRecordField()->getValue();
25 if ($value == '0000-00-00 00:00:00' or !$value) {
26 return $this->lng->txt('no_date');
27 }
28 return $this->formatDate($value, $ilUser->getDateFormat());
29 }
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18

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

+ 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

Reimplemented from ilDclBaseRecordRepresentation.

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

60 {
61 if (!$value || $value == "-") {
62 return null;
63 }
64 return substr($value, 0, -9);
65 }

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