ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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('Y-m-d', strtotime($value));
37  } else {
38  return "";
39  }
40  }
41 
45  public function parseExportValue($value): ?string
46  {
47  return (new ilDate($value, IL_CAL_DATE))->get(IL_CAL_DATE);
48  }
49 
53  public function parseSortingValue($value, bool $link = true): ?int
54  {
55  return strtotime($value);
56  }
57 
58  public function getFormulaValue(): string
59  {
60  return (string) strtotime($this->getValue() ?: '');
61  }
62 }
parseSortingValue($value, bool $link=true)
getValueFromExcel(ilExcel $excel, int $row, int $col)
const IL_CAL_DATE