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
+2 -2
View File
@@ -37,8 +37,8 @@ class UserResource extends JsonResource
'two_factor_authentication' => $this->two_factor_secret ? true : false,
'socialite_account' => $this->password ? false : true,
'storage' => $this->storage,
'created_at' => format_date($this->created_at, '%d. %b. %Y'),
'updated_at' => format_date($this->updated_at, '%d. %B. %Y'),
'created_at' => format_date($this->created_at, 'd. M. Y'),
'updated_at' => format_date($this->updated_at, 'd. M. Y'),
],
'relationships' => [
'settings' => new SettingsResource($this->settings),
@@ -133,13 +133,13 @@ class UserStorageResource extends JsonResource
->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' => $uploadMax !== 0 ? round(($record->upload / $uploadMax) * 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' => $downloadMax !== 0 ? round(($record->download / $downloadMax) * 100, 2) : 0,
'amount' => Metric::bytes($record->download)->format(),
]);
+3 -3
View File
@@ -32,9 +32,9 @@ class UserSubscription extends JsonResource
'capacity' => (int) $subscription['product']['metadata']['capacity'],
'capacity_formatted' => format_gigabytes($subscription['product']['metadata']['capacity']),
'slug' => $subscription['plan']['id'],
'canceled_at' => format_date($active_subscription['canceled_at'], '%d. %B. %Y'),
'created_at' => format_date($active_subscription['current_period_start'], '%d. %B. %Y'),
'ends_at' => format_date($active_subscription['current_period_end'], '%d. %B. %Y'),
'canceled_at' => format_date($active_subscription['canceled_at'], 'd. M. Y'),
'created_at' => format_date($active_subscription['current_period_start'], 'd. M. Y'),
'ends_at' => format_date($active_subscription['current_period_end'], 'd. M. Y'),
],
],
];