Configure the Date Field

This article explains what the Date field is and how to configure it in the Custom Type builder.


The Date field allows content writers to add a date that represents a calendar day.

Screenshot of a date field in the drag-and-drop editor.

Date vs. Timestamp

This field is different from the Timestamp field, which includes both a date and a time.

The visual builder

When configuring a Date field you'll see the options to set the Field name, API ID, and Field placeholder.

Screenshot of the date field editor.

JSON model

The following table displays the JSON configuration options available in the JSON editor.

type

string (required)

Value must be Date

config

object

Object for the configuration options

config.label

string

The label that shows up for the field in the document editor

config.default
string

If set to now, it will automatically fill with today's date.

The default value will only apply to newly created documents. When you set or change the default value, it will not change existing documents.

Example JSON configuration

The following JSON defines is a Date field with a default value of today’s date.

Copy
"example_date" : {
  "type" : "Date",
  "config" : {
    "label" : "Release Date",
    "default" : "now"
  }
}

API response example

Here is an API response example of a Date field with the API ID of example_date:

Copy
// API response example of a Date field

{
 //...
 "example_date": "2022-10-22"
}

Was this article helpful?
Not really
Yes, Thanks

Can't find what you're looking for? Get in touch with us on our Community Forum.