Giter VIP home page Giter VIP logo

Comments (16)

PH7-Jack avatar PH7-Jack commented on May 21, 2024 1

I'll think of a solution to do this treatment in livewire middleware, convert the string into an instance of carbon
This will be very useful

from wireui.

trippo avatar trippo commented on May 21, 2024 1

There is another problem: I'm on Rome(UTC+2) timezone and if I pass "2021-06-16 19:50:00" to DateTime picker i see on the frontend

16/06/2021 17:50

with these params

display-format="DD/MM/YYYY HH:mm"
parse-format="YYYY-MM-DD hh:mm:ss"

and with or without without-timezone

from wireui.

trippo avatar trippo commented on May 21, 2024 1

Can you give more information? I tried here and I couldn't reproduce

Your laravel timezone config is Europe/Rome?

Can you show me your component data using alpinejs tools?
image

image

from wireui.

trippo avatar trippo commented on May 21, 2024 1
Schermata 2021-06-17 alle 09 38 31

This problem there is also with select (not native) on a modal when you open the select

from wireui.

trippo avatar trippo commented on May 21, 2024 1

Modal fixed.
Leave open for Carbon

from wireui.

PH7-Jack avatar PH7-Jack commented on May 21, 2024

This is the error?
Cannot assign string to property App\Http\Livewire\Testing::$datetime of type ?Carbon\Carbon

from wireui.

trippo avatar trippo commented on May 21, 2024

Typed property App\Http\Livewire\Admin\Actions\CreateShopEntry::$dateTest must be an instance of Carbon\Carbon or null, string used

from wireui.

trippo avatar trippo commented on May 21, 2024

There is also another problem with dateTime component:
If you use a carbon date inside an eloquent for livewire model, you obtain an alpine error:
Livewire Entangle Error: Livewire property 'shopEntry.entered_at' cannot be found

But the value is setted on mount function like this:
$this->shopEntry->entered_at = now()->roundMinute(10);

I tried to format carbon with toIso8601String or others formats without success

from wireui.

PH7-Jack avatar PH7-Jack commented on May 21, 2024

You have a validation rule to binding directly to model property?

https://laravel-livewire.com/docs/2.x/properties#binding-models

from wireui.

trippo avatar trippo commented on May 21, 2024

You are right... there is not error with rule

from wireui.

PH7-Jack avatar PH7-Jack commented on May 21, 2024

Can you give more information? I tried here and I couldn't reproduce

Your laravel timezone config is Europe/Rome?

Can you show me your component data using alpinejs tools?
image

from wireui.

trippo avatar trippo commented on May 21, 2024

There is also another little ui problem with time picker..
If you have a modal with blur like
Schermata 2021-06-17 alle 09 37 54
and open a datetime picker
Schermata 2021-06-17 alle 09 38 20
it create a space at the bottom of the page
Schermata 2021-06-17 alle 09 38 31

from wireui.

PH7-Jack avatar PH7-Jack commented on May 21, 2024

The modal bug has been fixed

from wireui.

PH7-Jack avatar PH7-Jack commented on May 21, 2024

There is another problem: I'm on Rome(UTC+2) timezone and if I pass "2021-06-16 19:50:00" to DateTime picker i see on the frontend

16/06/2021 17:50

with these params

display-format="DD/MM/YYYY HH:mm"
parse-format="YYYY-MM-DD hh:mm:ss"

and with or without without-timezone

If this still persists, create a new issue to this bug

from wireui.

PH7-Jack avatar PH7-Jack commented on May 21, 2024

@trippo
The livewire community helped me find a solution to this.

livewire/livewire#3370

public function updatingDate(&$date)
{
    $date = Carbon::parse($date);
}

from wireui.

trippo avatar trippo commented on May 21, 2024

Work like a charme

from wireui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.