-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When ACF "Date Picker" field is used inside a "Flexible content" field always return epoch time from WPGraphQL Query #212
Comments
Hey @DenislavPopov As you noted, this is an issue with WPGraphQL for ACF and however they're resolving their (Marking as |
Hey @DenislavPopov, I transferred this issue over to WPGraphQL for ACF. |
Great, thanks! 🍻 |
Good to know we can do that for next time I send someone to do duplicate work 🤦 |
@DenislavPopov in my first attempt to reproduce, I was not able to. The date field nested within a flexible content layout is returning the date as expected: I tried reproducing with the following:
|
I just tried with WPGraphQL for ACF v2.2.0 as well and same results. A date picker field within a flexible field layout is resolving as expected. Can you check to see that the values stored in the database are what you expect? Also, can you share your ACF Field Group export to make sure I'm setting things up the same? |
@DenislavPopov this logic looks like it might possibly be a culprit? https://github.com/wp-graphql/wpgraphql-acf/blob/develop/src/FieldType/DatePicker.php#L33-L38 |
@DenislavPopov here's how the data is stored when I tested: I'm curious if the data is saving differently for you? |
Hi @jasonbahl Sending the info. The database entry looks saved in the same format and also when reloading the post page the field is correctly populated with the saved data: Export of the fields from my end: |
@DenislavPopov I was able to reproduce when the return format is changed. Investigating this further. |
Description
When ACF "Date Picker" field is used inside a "Flexible content" field, the returned value for this date field is always epoch time, disregarding the saved value. ( 1970-01-01T00:00:00+00:00 ).
Setup of the fields in ACF:
Saved settings on the page:
GraphQL result:
Steps to reproduce
Additional context
No response
WPGraphQL Version
1.27.0
WordPress Version
6.5.4
PHP Version
8.1.23
Additional environment details
WPGraphQL for ACF: version: 2.2.0
Please confirm that you have searched existing issues in the repo.
Please confirm that you have disabled ALL plugins except for WPGraphQL.
The text was updated successfully, but these errors were encountered: