Site docs are currently being updated 🚧 Thank you for your patience! 🙏

Date Picker

ACF
Last Upated: Thursday, Jan 25, 2024

date_picker

The Date Picker field is native to ACF (free) and provides users with a jQuery date selection popup interface to pick a date.

Resolve Type

The "date_picker" field type resolves as a "String" in the GraphQL Schema.

The date will be returned in the RFC3339 format.

Field Settings

Below you will find information about how various ACF field settings can impact how the field will map to the GraphQL Schema and/or modify resolution of the field when queried.

Field Configuration

<?php
add_action( 'acf/include_fields', function() {
if ( ! function_exists( 'acf_add_local_field_group' ) ) {
return;
}
acf_add_local_field_group(
[
{
"key": "my_field_group_",
"title": "My Field Group with date_picker",
"show_in_graphql": 1,
"graphql_field_name": "myFieldGroupWithDatePicker",
"map_graphql_types_from_location_rules": 0,
"graphql_types": [
"Page"
],
"fields": [
{
"key": "my_field_",
"label": "My Field",
"name": "my_field",
"type": "date_picker",
"show_in_graphql": 1,
"graphql_field_name": "myFieldWithDatePicker"
}
],
"location": [
[
{
"param": "post_type",
"operator": "==",
"value": "page"
}
]
]
}
]
);
});

Querying the Date Picker field