|
@@ 127-133 (lines=7) @@
|
| 124 |
|
* @param \OCP\IL10N $l The locale to use |
| 125 |
|
* @return string Formatted relative date string |
| 126 |
|
*/ |
| 127 |
|
public function formatDateRelativeDay($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) { |
| 128 |
|
if (substr($format, -1) !== '*' && substr($format, -1) !== '*') { |
| 129 |
|
$format .= '^'; |
| 130 |
|
} |
| 131 |
|
|
| 132 |
|
return $this->format($timestamp, 'date', $format, $timeZone, $l); |
| 133 |
|
} |
| 134 |
|
|
| 135 |
|
/** |
| 136 |
|
* Gives the relative date of the timestamp |
|
@@ 291-297 (lines=7) @@
|
| 288 |
|
* @param \OCP\IL10N $l The locale to use |
| 289 |
|
* @return string Formatted relative date and time string |
| 290 |
|
*/ |
| 291 |
|
public function formatDateTimeRelativeDay($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null) { |
| 292 |
|
if (substr($formatDate, -1) !== '^' && substr($formatDate, -1) !== '*') { |
| 293 |
|
$formatDate .= '^'; |
| 294 |
|
} |
| 295 |
|
|
| 296 |
|
return $this->format($timestamp, 'datetime', $formatDate . '|' . $formatTime, $timeZone, $l); |
| 297 |
|
} |
| 298 |
|
|
| 299 |
|
/** |
| 300 |
|
* Formats the date and time of the given timestamp |