resolved timezones

This commit is contained in:
Čarodej
2022-02-06 14:26:42 +01:00
parent 38e86b4b8b
commit 21e184f373
10 changed files with 37 additions and 54 deletions
@@ -66,13 +66,13 @@ class GetDashboardDataController extends Controller
->get();
$upload = $trafficRecords->map(fn ($record) => [
'created_at' => format_date($record->created_at, '%d. %B'),
'created_at' => format_date($record->created_at, 'd. M. '),
'percentage' => intval($trafficRecords->max('upload')) !== 0 ? round(($record->upload / $trafficRecords->max('upload')) * 100, 2) : 0,
'amount' => Metric::bytes($record->upload)->format(),
]);
$download = $trafficRecords->map(fn ($record) => [
'created_at' => format_date($record->created_at, '%d. %B'),
'created_at' => format_date($record->created_at, 'd. M. '),
'percentage' => intval($trafficRecords->max('download')) !== 0 ? round(($record->download / $trafficRecords->max('download')) * 100, 2) : 0,
'amount' => Metric::bytes($record->download)->format(),
]);
+5 -9
View File
@@ -33,15 +33,11 @@ class FileResource extends JsonResource
'thumbnail' => $this->thumbnail,
'metadata' => $this->metadata,
'parent_id' => $this->parent_id,
'updated_at' => $this->updated_at,
'created_at' => Carbon::parse($this->created_at)->diffForHumans(),
'deleted_at' => $this->deleted_at ? Carbon::parse($this->deleted_at)->diffForHumans() : null,
/*'updated_at' => format_date(
set_time_by_user_timezone($this->updated_at), __t('time')
),
'created_at' => format_date(
set_time_by_user_timezone($this->created_at), __t('time')
),*/
'created_at' => set_time_by_user_timezone($this->owner, $this->created_at),
'updated_at' => set_time_by_user_timezone($this->owner, $this->updated_at),
'deleted_at' => $this->deleted_at
? set_time_by_user_timezone($this->owner, $this->deleted_at)
: null,
],
'relationships' => [
$this->mergeWhen($this->shared, fn () => [
@@ -24,15 +24,11 @@ class FolderResource extends JsonResource
'isTeamFolder' => $this->team_folder,
'items' => $this->items,
'trashed_items' => $this->trashed_items,
'updated_at' => $this->updated_at,
'created_at' => Carbon::parse($this->created_at)->diffForHumans(),
'deleted_at' => $this->deleted_at ? Carbon::parse($this->deleted_at)->diffForHumans() : null,
/*'updated_at' => format_date(
set_time_by_user_timezone($this->updated_at), __t('time')
),
'created_at' => format_date(
set_time_by_user_timezone($this->created_at), __t('time')
),*/
'created_at' => set_time_by_user_timezone($this->owner, $this->created_at),
'updated_at' => set_time_by_user_timezone($this->owner, $this->updated_at),
'deleted_at' => $this->deleted_at
? set_time_by_user_timezone($this->owner, $this->deleted_at)
: null,
],
'relationships' => [
$this->mergeWhen($this->teamMembers, fn () => [
@@ -30,7 +30,7 @@ class TransactionResource extends JsonResource
'metadata' => $this->metadata
? resolve(FormatUsageEstimatesAction::class)($this->currency, $this->metadata)
: null,
'created_at' => $this->created_at->formatLocalized('%d. %b. %Y'),
'created_at' => $this->created_at->formatLocalized('d. M. Y'),
'updated_at' => $this->updated_at,
],
'relationships' => [