Date subfield advances date 1 day when submitting value between 9PM - 12AM

Created on 6 September 2024, 4 months ago

Problem/Motivation

Date subfield advances date 1 day when submitting value between 9PM - 12AM.

Steps to reproduce

1. Drupal 10 standard installation.
2. Regional settings: set timezone to your timezone.
2. Install and enable double_field module.
3. Add new double field to the basic page content type.
4. Add a Date subfield type (Date Only).
6. Set the field formatter to be table and Date subfield to use default medium date display.
8. Between 9PM and 12AM create a new basic page and set the date subfield value to be the current date and save.
9. Confirm the date value was updated to tomorrow in the display and the edit form.

This does not appear to affect the behavior of core Date fields.

πŸ› Bug report
Status

Active

Version

4.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States vector_ray

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @vector_ray
  • πŸ‡·πŸ‡ΊRussia Chi

    Confirm the date value was updated to tomorrow in the display and the edit form.

    Did you check the date value in the database? I wonder if it's only related to formatter.

  • πŸ‡·πŸ‡ΊRussia Chi

    Could not reproduce.
    This might be somehow related to your site timezone.

  • Status changed to Postponed: needs info about 1 month ago
  • πŸ‡ΊπŸ‡ΈUnited States vector_ray

    I can confirm it is not the formatter, when I edit the node again after saving the date is updated to the next day and continues to be updated to the next day upon each save but it is within a window 3 hours before midnight. This isn't an issue with core's date field so I don't believe it's related to a timezone configuration issue.

    I am considering whether a previously closed issue might be a clue as to what is happening here:
    https://www.drupal.org/project/double_field/issues/3067119 β†’

    I would note that this is also an issue with using `drush generate field` to make a compound field. However, the issue presents itself as updating the date to the previous date on save in that case.

Production build 0.71.5 2024