Skip to content

Commit

Permalink
Release 3.3.4a (#1073)
Browse files Browse the repository at this point in the history
* fix: Timezone isn't used in chart (#1070) -> #1066
* fix: date for logs (#1074) -> #1061
  • Loading branch information
CamillePMyddleware authored Oct 3, 2023
1 parent 3ac8701 commit f2d7d37
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/Controller/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2635,6 +2635,10 @@ public function graphJobHisto(): Response
{
$countTransferRule = [];
$jobs = $this->jobRepository->findBy([], ['begin' => 'ASC'], 5);

$timeZone = $this->get('session')->get('_timezone', 'UTC');
$userTimeZone = new \DateTimeZone($timeZone);

if (count($jobs)) {
$countTransferRule[] = [
'date',
Expand All @@ -2644,8 +2648,11 @@ public function graphJobHisto(): Response
$this->translator->trans('flux.gbl_status.close'),
];
foreach ($jobs as $job) {
$start = clone $job->getBegin();
$start->setTimezone($userTimeZone);

$countTransferRule[] = [
$job->getBegin()->format('d/m/Y H:i:s'),
$start->format('d/m/Y H:i:s'),
(int) $job->getOpen(),
(int) $job->getError(),
(int) $job->getCancel(),
Expand Down
4 changes: 2 additions & 2 deletions templates/Flux/view/view.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
<th>{{'list_flux.tab.name'|trans}}</th>
<th>{{'list_flux.tab.source_id'|trans}}</th>
<th>{{'list_flux.tab.target_id'|trans}}</th>
<th>{{'list_flux.tab.dateref'|trans}}</th>
<th>{{'llist_flux.tab.date_modified'|trans}}</th>
<th>{{'list_flux.tab.type'|trans}}</th>
<th>{{'list_flux.tab.statut'|trans}}</th>
</tr>
Expand Down Expand Up @@ -646,7 +646,7 @@
<a href="{{ path('task_view', {'id':log.getJob.id}) }}">{{ log.getJob.id }}</a>
{% endif %}
</td>
<td>{{ log.getDateCreated|date("d/m/Y H:i:s", timezone) }}</td>
<td>{{ log.getCreated|date("d/m/Y H:i:s", timezone) }}</td>
<td class="ctr">
<div class="log_{{ log.getType|lower }}">{{ log.getType }}
{% if log.getType|lower == 's' %}
Expand Down
2 changes: 1 addition & 1 deletion templates/Task/view/view.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
<a href="{{ path('flux_info', {'id': log.getDocument.id}) }}">{{ log.getDocument.id }}</a>
{% endif %}
</td>
<td>{{ log.getDateCreated|date("d/m/Y H:i:s", timezone) }}</td>
<td>{{ log.getCreated|date("d/m/Y H:i:s", timezone) }}</td>
<td class="ctr">
<div class="log_{{ log.getType|lower }}">{{ log.getType }}
{% if log.getType|lower == 's' %}
Expand Down

0 comments on commit f2d7d37

Please sign in to comment.