TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Fluid\ViewHelpers\Format\DateViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\ViewHelpers\Format\DateViewHelper:
TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface

Public Member Functions

 render ($date=null, $format='', $base=null)
 
- Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 setArguments (array $arguments)
 
 setRenderingContext (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 isEscapingInterceptorEnabled ()
 
 setViewHelperNode (\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node)
 
 setRenderChildrenClosure (\Closure $renderChildrenClosure)
 
 initializeArgumentsAndRender ()
 
 initialize ()
 
 renderChildren ()
 
 prepareArguments ()
 
 validateArguments ()
 
 initializeArguments ()
 
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 
 resetState ()
 
- Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 

Static Public Member Functions

static renderStatic (array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
 
- Static Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
static renderStatic (array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
- Static Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface
static renderStatic (array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 

Protected Attributes

 $escapingInterceptorEnabled = false
 
- Protected Attributes inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 $arguments
 
 $templateVariableContainer
 
 $controllerContext
 
 $renderingContext
 
 $renderChildrenClosure = null
 
 $viewHelperVariableContainer
 
 $objectManager
 
 $escapingInterceptorEnabled = true
 

Additional Inherited Members

- Protected Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 registerArgument ($name, $type, $description, $required=false, $defaultValue=null)
 
 overrideArgument ($name, $type, $description, $required=false, $defaultValue=null)
 
 callRenderMethod ()
 
 getLogger ()
 
 buildRenderChildrenClosure ()
 
 hasArgument ($argumentName)
 

Detailed Description

Formats an object implementing .

= Examples =

<f:format.date>{dateObject}</f:format.date> <output> 1980-12-13 (depending on the current date) </output>

<f:format.date format="H:i">{dateObject}</f:format.date> <output> 01:23 (depending on the current time) </output>

<f:format.date format="Y" base="{dateObject}">-1 year</f:format.date> <output> 2016 (assuming dateObject is in 2017) </output>

<f:format.date format="d.m.Y - H:i:s">+1 week 2 days 4 hours 2 seconds</f:format.date> <output> 13.12.1980 - 21:03:42 (depending on the current time, see http://www.php.net/manual/en/function.strtotime.php) </output>

<f:format.date format="%d. %B %Y">{dateObject}</f:format.date> <output>

  1. Dezember 1980 (depending on the current date and defined locale. In the example you see the 1980-12-13 in a german locale) </output>

{f:format.date(date: dateObject)} <output> 1980-12-13 (depending on the value of {dateObject}) </output>

{dateObject -> f:format.date()} <output> 1980-12-13 (depending on the value of {dateObject}) </output>

Definition at line 83 of file DateViewHelper.php.

Member Function Documentation

◆ render()

TYPO3\CMS\Fluid\ViewHelpers\Format\DateViewHelper::render (   $date = null,
  $format = '',
  $base = null 
)

Render the supplied DateTime object as a formatted date.

Parameters
mixed$dateeither an object implementing DateTimeInterface or a string that is accepted by DateTime constructor
string$formatFormat String which is taken to format the Date/Time
mixed$baseA base time (an object implementing DateTimeInterface or a string) used if $date is a relative date specification. Defaults to current time.
Returns
string Formatted date
Exceptions
Exception

Definition at line 101 of file DateViewHelper.php.

References TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper\buildRenderChildrenClosure().

◆ renderStatic()

static TYPO3\CMS\Fluid\ViewHelpers\Format\DateViewHelper::renderStatic ( array  $arguments,
\Closure  $renderChildrenClosure,
RenderingContextInterface  $renderingContext 
)
static
Parameters
array$arguments
\Closure$renderChildrenClosure
RenderingContextInterface$renderingContext
Returns
string
Exceptions
Exception

Definition at line 122 of file DateViewHelper.php.

References $GLOBALS, TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper\$renderChildrenClosure, and TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger().

Member Data Documentation

◆ $escapingInterceptorEnabled

TYPO3\CMS\Fluid\ViewHelpers\Format\DateViewHelper::$escapingInterceptorEnabled = false
protected

Definition at line 88 of file DateViewHelper.php.