[BUGFIX] Fix TypeError in workspace module
[Packages/TYPO3.CMS.git] / typo3 / sysext / indexed_search / Classes / ViewHelpers / Format / DateTimeViewHelper.php
1 <?php
2
3 /*
4 * This file is part of the TYPO3 CMS project.
5 *
6 * It is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License, either version 2
8 * of the License, or any later version.
9 *
10 * For the full copyright and license information, please read the
11 * LICENSE.txt file that was distributed with this source code.
12 *
13 * The TYPO3 project - inspiring people to share!
14 */
15
16 namespace TYPO3\CMS\IndexedSearch\ViewHelpers\Format;
17
18 use TYPO3\CMS\Backend\Utility\BackendUtility;
19 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
20 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
21 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
22
23 /**
24 * DateTime viewhelper
25 * @internal
26 */
27 class DateTimeViewHelper extends AbstractViewHelper
28 {
29 use CompileWithRenderStatic;
30
31 /**
32 * The rendered children are fed into data() function, which expects an integer.
33 * It reduces overhead and is safe to disable children escaping here.
34 *
35 * @var bool
36 */
37 protected $escapeChildren = false;
38
39 /**
40 * Render the given timestamp as date & time
41 *
42 * @param array $arguments
43 * @param \Closure $renderChildrenClosure
44 * @param RenderingContextInterface $renderingContext
45 *
46 * @return string
47 */
48 public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
49 {
50 return BackendUtility::datetime($renderChildrenClosure());
51 }
52 }