Issue with the date-only field

Created on 26 March 2025, 13 days ago

Problem/Motivation

There is an issue with the date-only field.

Steps to reproduce

  1. Create a date field in any content type.
  2. Save the field with a date value (e.g., 15 Mar 2025).
  3. Retrieve the field value using GraphQL. Expected result: The date should be returned with a noon timestamp (e.g., 15 Mar 2025 12:00:00 +0000). Actual result: The date is returned with a midnight timestamp (e.g., 15 Mar 2025 00:00:00 +0000). This is incorrect because the Drupal core datetime module adds noon time to ensure consistent display across time zones.

Proposed resolution

I have added a check and modified the code in graphql_compose/src/Plugin/GraphQLCompose/FieldType/DateTimeItem.php to add 12 hours to the date field value, resolving the issue.

🐛 Bug report
Status

Needs work

Version

2.2

Component

Code

Created by

🇮🇳India vikramsaini1609

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024