ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
class.ilDclDateRecordFieldModel.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 public function getValueFromExcel(ilExcel $excel, int $row, int $col): ?string
24 {
25 $value = parent::getValueFromExcel($excel, $row, $col);
26
27 if ($value && strtotime($value) > strtotime('0000-00-00 00:00:00')) {
28 return date(ilDclDateFieldModel::FORMAT, strtotime($value));
29 } else {
30 return "";
31 }
32 }
33
37 public function parseSortingValue($value, bool $link = true): ?int
38 {
39 return strtotime($value);
40 }
41
42 public function getFormulaValue(): string
43 {
44 return (string) strtotime($this->getValue() ?: '');
45 }
46
47 public function getPlainText(): string
48 {
49 return $this->getValue() ? date($this->user->getDateFormat()->toString(), strtotime($this->getValue())) : '';
50 }
51}
getValueFromExcel(ilExcel $excel, int $row, int $col)
parseSortingValue($value, bool $link=true)