Use [[PLACEHOLDER]] instead of %%PLACEHOLDER%% for label placeholders.

This commit is contained in:
Jan Böhmer 2020-04-25 18:19:15 +02:00
parent cb2d0d9845
commit 3163a7ba09
14 changed files with 80 additions and 78 deletions

View file

@ -33,11 +33,11 @@ class TimestampableElementProvider implements PlaceholderProviderInterface
public function replace(string $placeholder, object $label_target, array $options = []): ?string
{
if ($label_target instanceof TimeStampableInterface) {
if ($placeholder === '%%LAST_MODIFIED%%') {
if ($placeholder === '[[LAST_MODIFIED]]') {
return IntlDateFormatter::formatObject($label_target->getLastModified() ?? new \DateTime(), IntlDateFormatter::SHORT, Locale::getDefault());
}
if ($placeholder === '%%CREATION_DATE%%') {
if ($placeholder === '[[CREATION_DATE]]') {
return IntlDateFormatter::formatObject($label_target->getAddedDate() ?? new \DateTime(), IntlDateFormatter::SHORT, Locale::getDefault());
}