mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-25 03:08:51 +02:00
Use format_datetime filters from twig core instead of deprecated twig/extensions
This commit is contained in:
parent
26fe946de3
commit
cd5f099965
12 changed files with 19 additions and 100 deletions
|
@ -45,9 +45,8 @@
|
||||||
"symfony/web-link": "4.4.*",
|
"symfony/web-link": "4.4.*",
|
||||||
"symfony/webpack-encore-bundle": "^1.1",
|
"symfony/webpack-encore-bundle": "^1.1",
|
||||||
"symfony/yaml": "4.4.*",
|
"symfony/yaml": "4.4.*",
|
||||||
"twig/extensions": "^1.5",
|
"twig/extra-bundle": "^3.0",
|
||||||
"twig/extra-bundle": "3.x-dev",
|
"twig/intl-extra": "^3.0",
|
||||||
"twig/intl-extra": "3.x-dev",
|
|
||||||
"webmozart/assert": "^1.4"
|
"webmozart/assert": "^1.4"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
|
|
63
composer.lock
generated
63
composer.lock
generated
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "d5ab5fdad23b0879dba64df3d0c7346a",
|
"content-hash": "823d8542bcdaea46c533eedb6148de31",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "clue/stream-filter",
|
"name": "clue/stream-filter",
|
||||||
|
@ -7427,64 +7427,9 @@
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"time": "2019-11-12T14:51:11+00:00"
|
"time": "2019-11-12T14:51:11+00:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "twig/extensions",
|
|
||||||
"version": "v1.5.4",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/twigphp/Twig-extensions.git",
|
|
||||||
"reference": "57873c8b0c1be51caa47df2cdb824490beb16202"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/57873c8b0c1be51caa47df2cdb824490beb16202",
|
|
||||||
"reference": "57873c8b0c1be51caa47df2cdb824490beb16202",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"twig/twig": "^1.27|^2.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"symfony/phpunit-bridge": "^3.4",
|
|
||||||
"symfony/translation": "^2.7|^3.4"
|
|
||||||
},
|
|
||||||
"suggest": {
|
|
||||||
"symfony/translation": "Allow the time_diff output to be translated"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.5-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-0": {
|
|
||||||
"Twig_Extensions_": "lib/"
|
|
||||||
},
|
|
||||||
"psr-4": {
|
|
||||||
"Twig\\Extensions\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Fabien Potencier",
|
|
||||||
"email": "fabien@symfony.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Common additional features for Twig that do not directly belong in core",
|
|
||||||
"keywords": [
|
|
||||||
"i18n",
|
|
||||||
"text"
|
|
||||||
],
|
|
||||||
"time": "2018-12-05T18:34:18+00:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "twig/extra-bundle",
|
"name": "twig/extra-bundle",
|
||||||
"version": "3.x-dev",
|
"version": "v3.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/twigphp/twig-extra-bundle.git",
|
"url": "https://github.com/twigphp/twig-extra-bundle.git",
|
||||||
|
@ -7543,7 +7488,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "twig/intl-extra",
|
"name": "twig/intl-extra",
|
||||||
"version": "3.x-dev",
|
"version": "v3.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/twigphp/intl-extra.git",
|
"url": "https://github.com/twigphp/intl-extra.git",
|
||||||
|
@ -9454,8 +9399,6 @@
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": {
|
"stability-flags": {
|
||||||
"twig/extra-bundle": 20,
|
|
||||||
"twig/intl-extra": 20,
|
|
||||||
"roave/security-advisories": 20
|
"roave/security-advisories": 20
|
||||||
},
|
},
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
|
|
|
@ -16,8 +16,8 @@ return [
|
||||||
Omines\DataTablesBundle\DataTablesBundle::class => ['all' => true],
|
Omines\DataTablesBundle\DataTablesBundle::class => ['all' => true],
|
||||||
Shivas\VersioningBundle\ShivasVersioningBundle::class => ['all' => true],
|
Shivas\VersioningBundle\ShivasVersioningBundle::class => ['all' => true],
|
||||||
FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
|
FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
|
||||||
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
|
|
||||||
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
|
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
|
||||||
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
|
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
|
||||||
DAMA\DoctrineTestBundle\DAMADoctrineTestBundle::class => ['test' => true],
|
DAMA\DoctrineTestBundle\DAMADoctrineTestBundle::class => ['test' => true],
|
||||||
|
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
services:
|
|
||||||
_defaults:
|
|
||||||
public: false
|
|
||||||
autowire: true
|
|
||||||
autoconfigure: true
|
|
||||||
|
|
||||||
# Uncomment any lines below to activate that Twig extension
|
|
||||||
#Twig\Extensions\ArrayExtension: ~
|
|
||||||
#Twig\Extensions\DateExtension: ~
|
|
||||||
Twig\Extensions\IntlExtension: ~
|
|
||||||
#Twig\Extensions\TextExtension: ~
|
|
14
symfony.lock
14
symfony.lock
|
@ -688,20 +688,8 @@
|
||||||
"symfony/yaml": {
|
"symfony/yaml": {
|
||||||
"version": "v4.2.3"
|
"version": "v4.2.3"
|
||||||
},
|
},
|
||||||
"twig/extensions": {
|
|
||||||
"version": "1.0",
|
|
||||||
"recipe": {
|
|
||||||
"repo": "github.com/symfony/recipes",
|
|
||||||
"branch": "master",
|
|
||||||
"version": "1.0",
|
|
||||||
"ref": "ddb2e0a77773b7fd75d8d649545f174e664500ab"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"./config/packages/twig_extensions.yaml"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"twig/extra-bundle": {
|
"twig/extra-bundle": {
|
||||||
"version": "3.x-dev"
|
"version": "v3.0.0"
|
||||||
},
|
},
|
||||||
"twig/intl-extra": {
|
"twig/intl-extra": {
|
||||||
"version": "3.x-dev"
|
"version": "3.x-dev"
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<p class="form-control-plaintext">
|
<p class="form-control-plaintext">
|
||||||
|
|
||||||
{% if date(entity.addedDate) > date('1900/01/01') %}
|
{% if date(entity.addedDate) > date('1900/01/01') %}
|
||||||
{{ entity.addedDate | localizeddate("long") }}
|
{{ entity.addedDate | format_datetime("long") }}
|
||||||
{% else %}
|
{% else %}
|
||||||
-
|
-
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<p class="form-control-plaintext">
|
<p class="form-control-plaintext">
|
||||||
{% if date(entity.lastModified) > date('1900/01/01') %}
|
{% if date(entity.lastModified) > date('1900/01/01') %}
|
||||||
{{ entity.lastModified | localizeddate("long") }}
|
{{ entity.lastModified | format_datetime("long") }}
|
||||||
{% else %}
|
{% else %}
|
||||||
-
|
-
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -56,8 +56,8 @@
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu" aria-labelledby="btnGroupDrop1">
|
<div class="dropdown-menu" aria-labelledby="btnGroupDrop1">
|
||||||
<span class="text-muted dropdown-item-text" ><i class="fas fa-lightbulb fa-fw"></i> <b>ID:</b> {{ attachment.iD }}</span>
|
<span class="text-muted dropdown-item-text" ><i class="fas fa-lightbulb fa-fw"></i> <b>ID:</b> {{ attachment.iD }}</span>
|
||||||
<span class="text-muted dropdown-item-text" ><i class="fas fa-calendar fa-fw"></i> <b>{% trans %}createdAt{% endtrans %}:</b> {{ attachment.addedDate | localizeddate("short")}}</span>
|
<span class="text-muted dropdown-item-text" ><i class="fas fa-calendar fa-fw"></i> <b>{% trans %}createdAt{% endtrans %}:</b> {{ attachment.addedDate | format_datetime("short")}}</span>
|
||||||
<span class="text-muted dropdown-item-text" ><i class="fas fa-history fa-fw"></i> <b>{% trans %}createdAt{% endtrans %}:</b> {{ attachment.addedDate | localizeddate("short")}}</span>
|
<span class="text-muted dropdown-item-text" ><i class="fas fa-history fa-fw"></i> <b>{% trans %}createdAt{% endtrans %}:</b> {{ attachment.addedDate | format_datetime("short")}}</span>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item" href="#">{% trans %}attachment.edit{% endtrans %}</a>
|
<a class="dropdown-item" href="#">{% trans %}attachment.edit{% endtrans %}</a>
|
||||||
<a class="dropdown-item" href="#">{% trans %}attachment.delete{% endtrans %}</a>
|
<a class="dropdown-item" href="#">{% trans %}attachment.delete{% endtrans %}</a>
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr> {# Creation date #}
|
<tr> {# Creation date #}
|
||||||
<td>{% trans %}createdAt{% endtrans %}</td>
|
<td>{% trans %}createdAt{% endtrans %}</td>
|
||||||
<td>{{ part.addedDate | localizeddate("long")}}</td>
|
<td>{{ part.addedDate | format_datetime("long")}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr> {# Last modified date #}
|
<tr> {# Last modified date #}
|
||||||
<td>{% trans %}lastModified{% endtrans %}</td>
|
<td>{% trans %}lastModified{% endtrans %}</td>
|
||||||
<td>{{ part.lastModified | localizeddate("long")}}</td>
|
<td>{{ part.lastModified | format_datetime("long")}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr> {# ID #}
|
<tr> {# ID #}
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<span class="text-muted dropdown-item-text" ><i class="fas fa-lightbulb fa-fw"></i> <b>ID:</b> {{ order.iD }}</span>
|
<span class="text-muted dropdown-item-text" ><i class="fas fa-lightbulb fa-fw"></i> <b>ID:</b> {{ order.iD }}</span>
|
||||||
<span class="text-muted dropdown-item-text" ><i class="fas fa-history fa-fw"></i> <b>{% trans %}createdAt{% endtrans %}:</b> {{ order.addedDate | localizeddate("short")}}</span>
|
<span class="text-muted dropdown-item-text" ><i class="fas fa-history fa-fw"></i> <b>{% trans %}createdAt{% endtrans %}:</b> {{ order.addedDate | format_datetime("short")}}</span>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item" href="#"><i class="fas fa-edit fa-fw"></i> {% trans %}edit.caption_short{% endtrans %}</a>
|
<a class="dropdown-item" href="#"><i class="fas fa-edit fa-fw"></i> {% trans %}edit.caption_short{% endtrans %}</a>
|
||||||
<a class="dropdown-item" href="#"><i class="fas fa-trash fa-fw"></i> {% trans %}delete.caption{% endtrans %}</a>
|
<a class="dropdown-item" href="#"><i class="fas fa-trash fa-fw"></i> {% trans %}delete.caption{% endtrans %}</a>
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<h6>
|
<h6>
|
||||||
{% if lot.expirationDate %}
|
{% if lot.expirationDate %}
|
||||||
<span class="badge badge-info" title="{% trans %}part_lots.expiration_date{% endtrans %}">
|
<span class="badge badge-info" title="{% trans %}part_lots.expiration_date{% endtrans %}">
|
||||||
<i class="fas fa-calendar-alt fa-fw"></i> {{ lot.expirationDate | localizeddate }}
|
<i class="fas fa-calendar-alt fa-fw"></i> {{ lot.expirationDate | format_datetime }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if lot.expired %}
|
{% if lot.expired %}
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<span class="text-muted" title="{% trans %}lastModified{% endtrans %}">
|
<span class="text-muted" title="{% trans %}lastModified{% endtrans %}">
|
||||||
<i class="fas fa-history fa-fw"></i> {{ part.lastModified | localizeddate("short") }}
|
<i class="fas fa-history fa-fw"></i> {{ part.lastModified | format_datetime("short") }}
|
||||||
</span>
|
</span>
|
||||||
<br>
|
<br>
|
||||||
<span class="text-muted mt-1" title="{% trans %}createdAt{% endtrans %}">
|
<span class="text-muted mt-1" title="{% trans %}createdAt{% endtrans %}">
|
||||||
<i class="fas fa-calendar-plus fa-fw"></i> {{ part.addedDate | localizeddate("short") }}
|
<i class="fas fa-calendar-plus fa-fw"></i> {{ part.addedDate | format_datetime("short") }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -47,11 +47,11 @@
|
||||||
</a>
|
</a>
|
||||||
<div class="">
|
<div class="">
|
||||||
<span class="text-muted" title="{% trans %}lastModified{% endtrans %}">
|
<span class="text-muted" title="{% trans %}lastModified{% endtrans %}">
|
||||||
<i class="fas fa-history fa-fw"></i> {{ entity.lastModified | localizeddate("short") }}
|
<i class="fas fa-history fa-fw"></i> {{ entity.lastModified | format_datetime("short") }}
|
||||||
</span>
|
</span>
|
||||||
<br>
|
<br>
|
||||||
<span class="text-muted mt-1" title="{% trans %}createdAt{% endtrans %}">
|
<span class="text-muted mt-1" title="{% trans %}createdAt{% endtrans %}">
|
||||||
<i class="fas fa-calendar-plus fa-fw"></i> {{ entity.addedDate | localizeddate("short") }}
|
<i class="fas fa-calendar-plus fa-fw"></i> {{ entity.addedDate | format_datetime("short") }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue