ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
class.ilDclDateRecordFieldModel.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
26  public function parseValue($value): string
27  {
28  return (string) $value;
29  }
30 
31  public function getValueFromExcel(ilExcel $excel, int $row, int $col): ?string
32  {
33  $value = parent::getValueFromExcel($excel, $row, $col);
34 
35  if ($value) {
36  return date(ilDclDateFieldModel::FORMAT, strtotime($value));
37  } else {
38  return "";
39  }
40  }
41 
45  public function parseSortingValue($value, bool $link = true): ?int
46  {
47  return strtotime($value);
48  }
49 
50  public function getFormulaValue(): string
51  {
52  return (string) strtotime($this->getValue() ?: '');
53  }
54 }
parseSortingValue($value, bool $link=true)
getValueFromExcel(ilExcel $excel, int $row, int $col)