Skip to content

Commit 4fb744d

Browse files
committed
Fixed timezone issue in PDF reports
1 parent bc9b104 commit 4fb744d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

app/Http/Controllers/Api/V1/TimeEntryController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ public function aggregateExport(Organization $organization, TimeEntryAggregateEx
419419
'currency' => $currency,
420420
'group' => $group,
421421
'subGroup' => $subGroup,
422+
'timezone' => $timezone,
422423
'start' => $request->getStart()->timezone($timezone),
423424
'end' => $request->getEnd()->timezone($timezone),
424425
'debug' => $debug,

resources/views/reports/time-entry-aggregate/pdf.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
<div>
140140
<p style="font-size: 32px; font-weight: 600; margin-bottom: 5px;">Report</p>
141141
<div style="font-size: 16px; font-weight: 600; color: #71717a;">
142-
<span>{{ $start->format('d.m.Y') }} - {{ $end->format('d.m.Y') }}</span><br><br>
142+
<span>{{ $start->timezone($timezone)->format('d.m.Y') }} - {{ $end->timezone($timezone)->format('d.m.Y') }}</span><br><br>
143143
</div>
144144

145145
</div>

resources/views/reports/time-entry-index/pdf.blade.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
<div>
131131
<p style="font-size: 32px; font-weight: 600; margin-bottom: 5px;">Detailed Report</p>
132132
<div style="font-size: 16px; font-weight: 600; color: #71717a;">
133-
<span>{{ $start->format('d.m.Y') }} - {{ $end->format('d.m.Y') }}</span><br><br>
133+
<span>{{ $start->timezone($timezone)->format('d.m.Y') }} - {{ $end->timezone($timezone)->format('d.m.Y') }}</span><br><br>
134134
</div>
135135
</div>
136136
<div class="table-wrapper">
@@ -179,13 +179,13 @@
179179
</td>
180180
<td style="overflow-wrap: break-word; min-width: 75px;">{{ $timeEntry->user->name }}</td>
181181
<td style="overflow-wrap: break-word; min-width: 150px; text-align: center;">
182-
@if($timeEntry->start->format('Y-m-d') === $timeEntry->end->format('Y-m-d'))
183-
{{ $timeEntry->start->format('Y-m-d') }}
182+
@if($timeEntry->start->timezone($timezone)->format('Y-m-d') === $timeEntry->end->timezone($timezone)->format('Y-m-d'))
183+
{{ $timeEntry->start->timezone($timezone)->format('Y-m-d') }}
184184
@else
185-
{{ $timeEntry->start->format('Y-m-d') }} - <br> {{ $timeEntry->end->format('Y-m-d') }}
185+
{{ $timeEntry->start->timezone($timezone)->format('Y-m-d') }} - <br> {{ $timeEntry->end->timezone($timezone)->format('Y-m-d') }}
186186
@endif
187187
<br>
188-
{{ $timeEntry->start->format('H:i:s') }} - {{ $timeEntry->end->format('H:i:s') }}
188+
{{ $timeEntry->start->timezone($timezone)->format('H:i:s') }} - {{ $timeEntry->end->timezone($timezone)->format('H:i:s') }}
189189
</td>
190190
<td style="overflow-wrap: break-word; min-width: 75px;">
191191
{{ $interval->format($timeEntry->getDuration()) }}

0 commit comments

Comments
 (0)