DateTime Field Type

Additional attributes, defaults, and usage example for datetime fields.

Control Type
Input with type="datetime-local" attribute, which functions as a datetime picker in modern browsers, including the time.
Stored Value
String in ISO-8601 format, in second resolution and with timezone (e.g. 2017-03-09T14:25:52-05:00).

Usage Example

Here is an example that shows a field called publishedAt.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
export default {
  models: {
    Page: {
      fields: [
        { name: 'title', type: 'string', required: true },
        { name: 'publishedAt', type: 'datetime' },
      ],
    },
  },
}

The publishedAt field will be rendered as a datetime picker input.

DateTime Picker Field Control
DateTime Picker Field Control