Search Results for

    Show / Hide Table of Contents
    View Source

    Class TimeOnlyValueConverter

    Provides a property value converter for time only datetime property editors.

    Inheritance
    object
    PropertyValueConverterBase
    DateTimeValueConverterBase
    Namespace: Umbraco.Cms.Core.PropertyEditors.ValueConverters
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public class TimeOnlyValueConverter : DateTimeValueConverterBase, IPropertyValueConverter, IDiscoverable
    Remarks

    This is one of four property value converters derived from DateTimeValueConverterBase and storing their value as JSON with timezone information.

    Constructors

    View Source

    TimeOnlyValueConverter(IJsonSerializer, ILogger<TimeOnlyValueConverter>)

    Initializes a new instance of the TimeOnlyValueConverter class.

    Declaration
    public TimeOnlyValueConverter(IJsonSerializer jsonSerializer, ILogger<TimeOnlyValueConverter> logger)
    Parameters
    Type Name Description
    IJsonSerializer jsonSerializer
    ILogger<TimeOnlyValueConverter> logger

    Methods

    View Source

    ConvertToObject(DateTimeDto)

    Convert the intermediate representation to the final object.

    Declaration
    protected override object ConvertToObject(DateTimeValueConverterBase.DateTimeDto dateTimeDto)
    Parameters
    Type Name Description
    DateTimeValueConverterBase.DateTimeDto dateTimeDto

    The intermediate representation.

    Returns
    Type Description
    object

    The final object.

    View Source

    GetPropertyValueType(IPublishedPropertyType)

    Gets the type of values returned by the converter.

    Declaration
    public override Type GetPropertyValueType(IPublishedPropertyType propertyType)
    Parameters
    Type Name Description
    IPublishedPropertyType propertyType

    The property type.

    Returns
    Type Description
    Type

    The CLR type of values returned by the converter.

    Remarks

    Some of the CLR types may be generated, therefore this method cannot directly return a Type object (which may not exist yet). In which case it needs to return a ModelType instance.

    View Source

    IsConverter(IPublishedPropertyType)

    Gets a value indicating whether the converter supports a property type.

    Declaration
    public override bool IsConverter(IPublishedPropertyType propertyType)
    Parameters
    Type Name Description
    IPublishedPropertyType propertyType

    The property type.

    Returns
    Type Description
    bool

    A value indicating whether the converter supports a property type.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX