Ranged date field ranged saves dates minus one - PHP cms

Bug Description

The date field (ranged in this case) always saves the dates a day before.

How to Reproduce

field:
          mode: range
          time_enabled: false
          time_required: false
          earliest_date: '2020-01-01'
          full_width: true
          inline: true
          columns: 1
          rows: 1
          type: date
          listable: hidden
          instructions: 'When is the climate adaptation week?'
          display: 'Climate adaptation week'

Extra Detail

Screenshot 2020-09-02 at 11 05 51

Environment

Statamic 3.0.2 Pro Laravel 7.26.1 PHP 7.4.6 No addons installed

Install method (choose one): - Starter Kit Peak

Asked Oct 10 '21 06:10
avatar robdekort
robdekort

9 Answer:

Update: tested with the non ranged datepicker. That one works fine. It's the ranged picker that's unusable atm.

1
Answered Sep 10 '20 at 10:05
avatar  of robdekort
robdekort

Here's a little demo package. Go to the globals -> configuration, save a ranged date and refresh the page.

1
Answered Sep 15 '20 at 19:07
avatar  of robdekort
robdekort

Odd. Seems fine to me, even in the site you zipped up. Tried multiple browsers.

1
Answered Sep 30 '20 at 15:09
avatar  of jasonvarga
jasonvarga

Really odd. Maybe it’s fixed in the latest releases. Will check later tonight and report back Sir.

1
Answered Sep 30 '20 at 15:22
avatar  of robdekort
robdekort

Still here. Just like in #2565 I can give you access to the same repo with this issue.

1
Answered Sep 30 '20 at 18:09
avatar  of robdekort
robdekort

Just added you to https://github.com/studio1902/klimaatadaptatiegroningen. Let me know if that doesn't work for you. The ranged picker with this issue is on Globals > Configuration.

I'm now thinking: since you couldn't replicate this in my previous zip you probably also can't on this repo. Could this be a local/timezone thing?

Last but not least. A little gif to prove I'm not talking nonsense here: its-real

1
Answered Sep 30 '20 at 18:16
avatar  of robdekort
robdekort

the off by one is definitely a timezone issue. Solved this in a (non-Statamic) project. Likely the front end is not setting to the server's timezone.

I can find the check in my project that fixed this if needed

1
Answered Sep 30 '20 at 22:25
avatar  of edalzell
edalzell

same for me. looks fine after saving, but when you reload, you see the date - 1 Screen Capture on 2020-11-18 at 16-31-16

1
Answered Nov 18 '20 at 15:33
avatar  of goellner
goellner

I have the same problem, any ideas on how to give you more info in order to solve this?

1
Answered Dec 05 '20 at 19:21
avatar  of afonic
afonic