Undefined array key 0 for datepicker #1847
ericowennelson
started this conversation in
BUG
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Livewire PowerGrid version
v5 and v6
Livewire version
v3.5.16
Laravel version
11.34.2
Which PHP version are you using?
PHP 8.4
Which Theme are you using?
None
Have you published the resource files and customized them? (php artisan vendor:publish)
Yes
What is the problem?
issue in
https://github.com/Power-Components/livewire-powergrid/blob/5.x/src/Components/Filters/Builders/DatePicker.php
for function collection :
should be
As it causes "Undefined array key 0" for some calling (specially when dealing with a csv datasource)
Could you please have a look and fix it
Code snippets
public function datasource(): Collection
{
// Parse the CSV file into a Collection
$csvFilePath = storage_path('claims-history/Historical_claims_example_4_test.csv');
public function parseCsvToCollection(string $filePath): Collection
{
$csv = Reader::createFromPath($filePath, 'r');
$csv->setHeaderOffset(0); // First row as header
How do you expect it to work?
allow correct date selection to work
Please confirm (incomplete submissions will not be addressed)
Beta Was this translation helpful? Give feedback.
All reactions