mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-13 20:04:34 +02:00
Use [[PLACEHOLDER]] instead of %%PLACEHOLDER%% for label placeholders.
This commit is contained in:
parent
cb2d0d9845
commit
3163a7ba09
14 changed files with 80 additions and 78 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue