Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Latest commit

 

History

History
40 lines (30 loc) · 873 Bytes

date-time-picker.md

File metadata and controls

40 lines (30 loc) · 873 Bytes

Date/Time Picker Field

The Date/Time Picker field is added to the WPGraphQL Schema as field with the Type String.

Date/Time Picker fields can be queried, and a String will be returned.

Here, we have a Date/Time Picker field named date_time_picker on the Post Edit screen within the "ACF Docs" Field Group, and "20/03/2020 8:15 am" is the value.

Date Picker field in the Edit Post screen

This field can be queried in GraphQL like so:

{
  post(id: "acf-example-test", idType: URI) {
    acfDocs {
      dateTimePicker
    }
  }
}

and the result of the query would be:

{
  "data": {
    "post": {
      "acfDocs": {
        "dateTimePicker": "20/03/2020 8:15 am"
      }
    }
  }
}