Conditions | 3 |
Paths | 4 |
Total Lines | 22 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
34 | public function getColumnValue(Row $row) |
||
35 | { |
||
36 | $value = parent::getColumnValue($row); |
||
37 | |||
38 | if (!($value instanceof DateTime)) { |
||
39 | /** |
||
40 | * Try to convert string to DateTime object |
||
41 | */ |
||
42 | try { |
||
43 | $date = DateTimeHelper::tryConvertToDateTime($value); |
||
44 | |||
45 | return $date->format($this->format); |
||
46 | } catch (DataGridDateTimeHelperException $e) { |
||
47 | /** |
||
48 | * Otherwise just return raw string |
||
49 | */ |
||
50 | return $value; |
||
51 | } |
||
52 | } |
||
53 | |||
54 | return $value->format($this->format); |
||
55 | } |
||
56 | |||
71 |