techouse / intl-date-time

International DateTime for Laravel Nova
MIT License
57 stars 21 forks source link

Timezones messing up #19

Closed kosmonowt closed 4 years ago

kosmonowt commented 4 years ago

Hi,

I am wondering about the following issue (sitting in TZ Europe/Berlin):

  1. The NovaController sends the datetime string as it's saved in my database, which doesn't handle timezones (e.g. 2020-01-01 09:00:00 in the DB will be persisted exactly like this).

  2. My Nova resource index, detail and edit view will show 2020-01-01 09:00:00 (respectively 01.01.2020 09:00 likewise.

  3. Now I am saving my resource without opening the datepicker for changes. XHR sends 2020-01-01 09:00:00.

  4. NovaResourceController will take it and save it as it is. Db content shows 2020-01-01 09:00:00. XHR sends it likewise.

  5. Now I open the edit view again (still showing 01.01.2020 09:00) and click the DatePicker, regardless if a change was made. The date in my input field still shows 01.01.2020 09:00.

  6. Again, saving my resource. XHR now sends the time back to the server in UTC 2020-01-01 08:00:00 where it gets saved in that way.

Anyone having a hint how to approach this problem?

I am using the flatpickr in a standalone-version in another project, where the submission is correct. Which option am I forgetting to use?

Thanks for your help!

techouse commented 4 years ago

Possible duplicate of #15 ?

techouse commented 4 years ago

@kosmonowt Have you had a chance yet to look at #15, because it sounds to me that you have some misconfiguration somewhere.

P.S.: I developed this package in the Europe/Ljubljana timezone (which is the same as yours basically), so I would have probably picked this issue up during development.

kosmonowt commented 4 years ago

Hi Klemen,

Thanks for the follow up, I’ve not hat the time, yet.

I’ll reply to it ASAP.

Andreas

Am 01.02.2020 um 10:48 schrieb Klemen Tušar notifications@github.com:

 @kosmonowt Have you had a chance yet to look at #15, because it sounds to me that you have some misconfiguration somewhere.

P.S.: I developed this package in the Europe/Ljubljana timezone, so I would have probably picked this issue up during development.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

techouse commented 4 years ago

Hi Klemen, Thanks for the follow up, I’ve not hat the time, yet. I’ll reply to it ASAP. Andreas

Any luck?

kosmonowt commented 4 years ago

yes, you're right. #invalid #duplicate thanks.