TextElement
in package
implements
PatternElement
FinalYes
Represents literal text in a date pattern.
Tags
Table of Contents
Interfaces
- PatternElement
- Represents an element in a compiled date pattern.
Methods
- __construct() : mixed
- Creates a date-pattern text element.
- appended() : self
- Returns an element with appended literal text.
- format() : string
- Formats this element for a date.
- text() : string
- Returns the literal text.
Methods
__construct()
Creates a date-pattern text element.
public
__construct(string $text) : mixed
Parameters
- $text : string
-
Literal text.
appended()
Returns an element with appended literal text.
public
appended(string $text) : self
Parameters
- $text : string
-
Text to append.
Return values
self —Element containing both text fragments.
format()
Formats this element for a date.
public
format(CalendarDate $date, Locale $locale) : string
Parameters
- $date : CalendarDate
-
Date being formatted.
- $locale : Locale
-
Locale definition.
Return values
string —Literal text.
text()
Returns the literal text.
public
text() : string
Return values
string —Literal text.