Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] Change connected date format to same as jetstream #41

Merged
merged 4 commits into from
Jan 13, 2021

Conversation

miguilimzero
Copy link
Contributor

@miguilimzero miguilimzero commented Jan 13, 2021

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".

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".
@joelbutcher
Copy link
Owner

joelbutcher commented Jan 13, 2021

@SrDante you can customise this by overriding the method in the published ConnectedAccount model stub?

@joelbutcher joelbutcher changed the title Change connected date format to same as jetstream [2.x] Change connected date format to same as jetstream Jan 13, 2021
@joelbutcher
Copy link
Owner

Can you also update the ConnectedAccountForm for Livewire please.

@joelbutcher
Copy link
Owner

@SrDante ConnectedAccountForm.php needs updating too. I'm thinking we just use a getSharedData method on the ConnectedAccount abstract:

/**
 * Get the data that should be shared with Inertia.
 *
 * @return array
 */
public function getSharedInertiaData()
{
    return $this->getSharedData();
}

/**
 * Get the data that should be shared by default.
 *
 * @return array
 */
public function getSharedData()
{
    return [
        'id' => $this->id,
        'provider' => $this->provider,
        'created_at' => $this->created_at->diffForHumans(),
    ];
}

@miguilimzero
Copy link
Contributor Author

I totally forgot the livewire stack! Sorry for that.

@joelbutcher
Copy link
Owner

No worries!

@joelbutcher joelbutcher merged commit afad0e1 into joelbutcher:2.x Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants