MedicOneSystems / MedicOneSystems/livewire-datatables
Table column labels unpredictable with dates
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.2k
- Forks
- 257
- PR merge metrics
- No merged PRs in 30d
Description
If I include the dates attribute, then the custom labels provided in include disappear. In below example, two columns should say "Domain Expires" and "Hosting Expires". In practice, they both say "Expires". However I remove the dates attribute, the labels will be correct. Important to note that the non-date label works in both cases, so this only seems to affect date columns.
<livewire:datatable
model="App\Models\Domain"
with="hosting.expiry"
include="domain|Domain Name, expiry|Domain Expires, hosting.expiry|Hosting Expires"
dates="expiry, hosting.expiry"
/>
This can be seen in your Intermediate example here too: https://livewire-datatables.com/intermediate
You include column created_at|Created, and yet it appears in the table labelled as "Created At".
It seems to default to the mysql column name for date fields, but I'm just getting started with Laravel and couldn't figure out a fix.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using the Intermediate example at https://livewire-datatables.com/intermediate and the provided datatable configuration. Trace how the dates and include attributes determine column labels; done means custom labels such as "Created" and "Hosting Expires" remain visible for date columns, with coverage for the reported case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100