Skip to content

Commit

Permalink
[2.x] use 'diffForHumans' for connected account dates
Browse files Browse the repository at this point in the history
[2.x] Change connected date format to same as jetstream
  • Loading branch information
joelbutcher authored Jan 13, 2021
2 parents 09e9763 + df8a64a commit afad0e1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ConnectedAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function getSharedInertiaData()
return [
'id' => $this->id,
'provider' => $this->provider,
'created_at' => (new \DateTime($this->created_at))->format('d/m/Y H:i'),
'created_at' => optional($this->created_at)->diffForHumans(),
];
}
}
2 changes: 1 addition & 1 deletion src/Http/Livewire/ConnectedAccountsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function getAccountsProperty()
return (object) [
'id' => $account->id,
'provider_name' => $account->provider,
'created_at' => (new \DateTime($account->created_at))->format('d/m/Y H:i'),
'created_at' => optional($account->created_at)->diffForHumans(),
];
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</div>

<div v-if="createdAt !== null" class="text-xs text-gray-500">
Connected on {{ createdAt }}
Connected {{ createdAt }}
</div>

<div v-else class="text-xs text-gray-500">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

@if (! is_null($createdAt))
<div class="text-xs text-gray-500">
Connected on {{ $createdAt }}
Connected {{ $createdAt }}
</div>
@else
<div class="text-xs text-gray-500">
Expand Down

0 comments on commit afad0e1

Please sign in to comment.