-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
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:

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:

It even supports the pickers to select the time:

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

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...).