TC
Twill CMS14mo ago
emil

DatePicker problem

Hi! sorry, what s wrong with my setup .... Just installed a fresh laravel app, with newest twill 3 - wonderful! Could not figure out, why a datetime field (saved as datetime column in db) saves the field correct to database - eg. 2023-11-11 14:00:00 - with DatePicker component . In index view its displaying correct, in db it s also correct, but when I come back to edit my fresh created record it displays 1 hour ahead - so instead of 14:00 it displays 15:00 .... Thanks a lot!
2 Replies
ifox
ifox14mo ago
hi @emil is your Laravel default timezone set to UTC? Twill is storing dates using the timezone of your Laravel app, and that should always be UTC to avoid any issues with timezones. In the UI we show you times in your computer's timezone.
emil
emilOP14mo ago
Hi @ifox - thank you! This means on the other side, on getting the value back - to either transform the value to my timezone via accessor in the model, or for the ui in index view (table column) to make use of the customRender method - is that the intended behavior? Background: Yesterday I was upgrading one of my websites with twill 2 and laravel 9 and on doing this I started to refactor some things .... in the end and after hours I was really confused so I started to play with a fresh installed laravel and twill app, but the behavior still didn't change. One thing I didn't know was that the twill UI automatically uses my computers timezone. This is now more understandable for me - thank you!
Want results from more Discord servers?
Add your server