Skip to content

calling IContent.GetValue<DateOnly?>() on a DatePicker property results in a null value #21992

@robertjf

Description

@robertjf

Which Umbraco version are you using?

17.2.1

Bug summary

I have a property configured as a DateOnly editor, and retrieving the value on an IContent node using GetValue<DateOnly?>() or GetValue<DateOnly>() returns null or minimum date respectively instead of the actual value:

For example, the following image shows the raw value when called using the non-Generic form of GetValue and what happens when called with the Generic form:

Image

This also produces similar output if I attempt to retrieve the value as a DateTime as well.

Specifics

See above

Steps to reproduce

  1. Create a document type with a DateOnly property editor on it
  2. Create a node based on the document type and set the property to a valid value.
  3. Attempt to retrieve the value using the ContentService and IContent representation of the node
  4. Value will be null if calling content.GetValue<DateOnly?>()

Expected result / actual result

The actual value should be returned

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions