Date Only
Schema Alias: Umbraco.DateOnly
UI Alias: Umb.PropertyEditorUi.DateOnlyPicker
Returns: DateOnly?
The Date Only property editor provides an interface for selecting dates without including time or time zone information. It focuses purely on date selection and returns a DateOnly value.
Configuration
You can configure this property editor in the same way as any standard property editor, using the Data Types admin interface.
To set up a property using this editor, create a new Data Type and select Date Only from the list of available property editors.
This editor has no configuration options.
Editing experience
Adding or editing a value
You will be presented with a date input.

Rendering
The value returned will have the type DateOnly?.
Display the value
With Models Builder:
Without Models Builder:
Add values programmatically
This property editor stores values as a JSON object. The object contains the date as an ISO 8601 string with midnight time and UTC offset.
Storage format
The property editor stores values in this JSON format:
The property editor handles date-only values. Time is set to 00:00:00 and offset to +00:00 for storage consistency. These time components are ignored in the Date Only context.
Create a C# model that matches the JSON schema.
Convert your existing date value to
DateTimeOffsetfor storage.If you have a
DateOnly:If you have a
DateTime:Create an instance of the class with the
DateTimeOffsetvalue.Inject the
IJsonSerializerand use it to serialize the object.Inject the
IContentServiceto retrieve and update the value of a property of the desired content item.
Getting values programmatically
For an example on how to work with DateOnly property using IContentService see the Getting date values programmatically article.
Last updated
Was this helpful?