Closed trippo closed 2 years ago
Can check it again? What's your alpine version?
Alpine: 3.2.1 I think because the field is cast to a Carbon I think when you implement carbon type this issue will be resolve
@trippo i got the same bug. how you resolve the issue?
@trippo i got the same bug. how you resolve the issue?
use timezone="UTC" in datetime picker and Carbon::parse($value)->timezone(Config::get('app.timezone'));
@diazsasak @visoftdev pass the user-timezone and the system timezone
<x-datetime-picker :timezone="$timezone" :user-timezone="$userTimezone" ... />
The user timezone is the navigator timezone by default The System Timezone is UTC by default
I use in blade:
<x-datetime-picker label="Thời gian" timezone="UTC" time-format=24 interval=30 class="my-2" placeholder="Chọn thời gian" wire:model="datetime" />
in component:
$date = Carbon::parse($this->datetime)->timezone(Config::get('app.timezone'));
It worked!
Thanks
I used timezone="UTC" user-timezone="UTC" and carbon with default config ('Europe/Rome')
Why close, this hasn't been resolved. The problem is we have to manually adjust the timezone instead of using what Carbon has already provided.
There is another problem: I'm in 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