From ccbbe464f45c4a1ad907ac1dd3e9a68192fe3f0e Mon Sep 17 00:00:00 2001
From: Dante <35383529+srdante@users.noreply.github.com>
Date: Tue, 12 Jan 2021 22:05:29 -0300
Subject: [PATCH 1/4] Change connected date format to same as jetstream
This pull request will change the "Connected on ..." format to the same as Jetstream Api Tokens last used ago.
It will changed the date format from 'd/m/Y H:i', since its not a unified format and not customizable, to the diffForHumans() function, example: "6 minutes ago".
---
src/ConnectedAccount.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ConnectedAccount.php b/src/ConnectedAccount.php
index 222c92e7..0e17868f 100644
--- a/src/ConnectedAccount.php
+++ b/src/ConnectedAccount.php
@@ -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(),
];
}
}
From 3f42bfde3da61429b0e6b774886aa9d4a604e83f Mon Sep 17 00:00:00 2001
From: Dante <35383529+srdante@users.noreply.github.com>
Date: Tue, 12 Jan 2021 22:06:58 -0300
Subject: [PATCH 2/4] Update ConnectedAccount.vue
---
stubs/inertia/resources/js/Socialstream/ConnectedAccount.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/stubs/inertia/resources/js/Socialstream/ConnectedAccount.vue b/stubs/inertia/resources/js/Socialstream/ConnectedAccount.vue
index d6f664a8..8eb3614e 100644
--- a/stubs/inertia/resources/js/Socialstream/ConnectedAccount.vue
+++ b/stubs/inertia/resources/js/Socialstream/ConnectedAccount.vue
@@ -17,7 +17,7 @@
- Connected on {{ createdAt }}
+ Connected {{ createdAt }}
From e25280587aa8fc89c4dcf871e91cab1b039d7102 Mon Sep 17 00:00:00 2001
From: Dante <35383529+srdante@users.noreply.github.com>
Date: Wed, 13 Jan 2021 12:11:09 -0300
Subject: [PATCH 3/4] Update connected-account.blade.php
---
.../resources/views/components/connected-account.blade.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/stubs/livewire/resources/views/components/connected-account.blade.php b/stubs/livewire/resources/views/components/connected-account.blade.php
index ce2468ff..f25766f6 100644
--- a/stubs/livewire/resources/views/components/connected-account.blade.php
+++ b/stubs/livewire/resources/views/components/connected-account.blade.php
@@ -35,7 +35,7 @@
@if (! is_null($createdAt))
- Connected on {{ $createdAt }}
+ Connected {{ $createdAt }}
@else
From df8a64a220bb7db14c9e83243baad86ae5d450db Mon Sep 17 00:00:00 2001
From: Dante <35383529+srdante@users.noreply.github.com>
Date: Wed, 13 Jan 2021 12:23:42 -0300
Subject: [PATCH 4/4] Update ConnectedAccountsForm.php
---
src/Http/Livewire/ConnectedAccountsForm.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Http/Livewire/ConnectedAccountsForm.php b/src/Http/Livewire/ConnectedAccountsForm.php
index e134de64..e93f429d 100644
--- a/src/Http/Livewire/ConnectedAccountsForm.php
+++ b/src/Http/Livewire/ConnectedAccountsForm.php
@@ -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(),
];
});
}