Can not use TimeSpan as property type

Vote:
 

Hello!

I am trying to have a property of type TimeSpan, but when I build and try to get to the CMS it just complains about: 

The backing type 'EPiServer.SpecializedProperties.PropertyTimeSpan' is not a registered PropertyDefinitionType

My property definition looks like this:

        [CultureSpecific]

        [Display(

            Name = "From",

            Description = "From",

            GroupName = SystemTabNames.Content,

            Order = 1)]

        public virtual TimeSpan From { get; set; }

What could be wrong?

#120460
Apr 17, 2015 13:43
Vote:
 

Hi!

The code for the TimeSpan property seems to be a remnant from the CMS 6 editing system. It has never been tested or supported for CMS 7+ as far as I can see from looking at the code. If you need to have such a property, you probably have to create your own custom property. A list of built in property types can be found here: http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-CMS/8/Content/Properties/Property-types/built-in-property-types/

#120464
Apr 17, 2015 15:17
Vote:
 

Ah, thank you Linus. I will see if I will create a custom property or solve it another way :)

#120469
Apr 17, 2015 15:48
Vote:
 

+1, create and share. got similar issue recently ;) not solved yet

#120511
Apr 19, 2015 22:59
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.