Skip to content

v16: Time-only DateTime picker #19865

@Luuk1983

Description

@Luuk1983

Which Umbraco version are you using?

16.1.1

Bug summary

I want to have a time-only property editor. Everything in the backoffice facilitates this and you even get a nice time-only picker, but it will throw an error when saving.

Specifics

No response

Steps to reproduce

Create a time data type using the Date Picker Property Editor UI and supply a date format of HH:mm:

Image

When you use that data type on your content type, it actually displays a very nice time selector that even has a clock instead of a calendar icon:

Image

It even supports the pickers to select the time:

Image

Awesome, that's exactly when I want! However when saving....

Image

And it's the obvious error I expected:
System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.

Expected result / actual result

I guess it's a scenario that wasn't considered, but since it works so well to have a time-only property editor, it's a real shame it cannot be used. I think this should be fixed one of two ways:

  • Support the time-only version (can't we use datetime2 in the database?)
  • Or make sure that the date format on the property editor cannot be invalid. (In which case I need to make a custom data editor for time-only myself...).

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