wireui / wireui

TallStack UI components
https://v1.wireui.dev
MIT License
1.37k stars 166 forks source link

Unable to use DateTime Picker Component #230

Closed 4inka closed 2 years ago

4inka commented 2 years ago

I'm trying to use the datetime picker component for wireui but it just gives me an undefined value in the field (screenshot 1) and I'm getting lots of console warnings and errors (screenshots 2 & 3 are some of the examples) Also when I try to click the input it gives me more warnings and errors (screenshot 4)

Screenshot 1 Screenshot from 2022-03-22 22-18-59

Screenshot 2 Screenshot from 2022-03-22 22-17-43

Screenshot 3 Screenshot from 2022-03-22 22-18-20

Screenshot 4 Screenshot from 2022-03-22 22-18-45

Here is the sample code that I'm trying to use for the datetime picker field:

class HomeSearchForm extends Component
{
    public $pickup_location, $pickup_datetime, $drop_location, $drop_datetime;

    public function render()
    {
        $locations = BookingLocation::all();

        return view('livewire.home-search-form', compact(['locations']));
    }
}
<x-datetime-picker label="Date & time" placeholder="Date & time" without-timezone :min="now()" parse-format="DD-MM-YYYY HH:mm" interval="30" wire:model.defer="pickup_datetime" />

These are the versions of the packages related to wire ui:

Best regards

PH7-Jack commented 2 years ago

@4inka Thanks for reporting. Do you have the wireui lang? I'm seeing in your Screenshot 2, the translation is missing

4inka commented 2 years ago

I am unable to publish the lang files, it gives me the following error: Screenshot from 2022-03-23 15-06-28

I was able to publish the other files

joelhmetz commented 2 years ago

Put in this order:

4inka commented 2 years ago

I've already tried it

also tried adding alpine as a npm dependency but still got no sucess. The screenshots bellow are the latest version of what I tried to use in order to solve this issue but nothing works

layout.blade.php Screenshot from 2022-03-23 20-25-26

app.js Screenshot from 2022-03-23 20-27-45

I've already tried a lot of different ways and versions of alpine and nothing seems to work properly.

4inka commented 2 years ago

I was able to use it in a fresh project. Don't understand what was wrong with my old one, but I'll stick to the new one and transfer the things that are already done to the new one and see if it doesn't break it.

But thank you for the attention

Edit

Unfortunatelly it did it again. I created a fresh project, added the first 2 migrations and some styles and everything was working, but after adding some more data it did the same thing. I didn't add any other dependency beside the ones related to wireui and still got the error out of nowhere

Edit 2

I created a git repo that has a sample project with the bug that I'm facing. I tested it in another computer and got the same result. Hope this helps

mckenziearts commented 2 years ago

I already had this problem, but you have to look in the .env file to see if your APP_URL is the same one that is returned by your project.

I work with Laravel Valet in https and my APP_URL was not https so I had this error.

Empty the cache where you display the url of this error is because it can not load the js of wireui

4inka commented 2 years ago

Corrected that and still no result.

joelhmetz commented 2 years ago

wireui_test/tailwind.config.js

check your file, the form plugin is missing

4inka commented 2 years ago

I removed it by mistake from this project but already added it back and updated the sample project. But in my original project I have the forms plugin there and it's still doing the same.

4inka commented 2 years ago

Hi

Any update on this

Edit

I was finally able to find out what the issue was. I was getting the undefined error because I changed the 'locale' and 'fallback_locale' to 'en_US' instead of 'en' inside config/app.php and didn't create a folder named 'en_US' under lang/vendor/wireui. After creating the folder inside the mentioned directory everything started working fine again.