Class DateTimeUnspecifiedValueConverter
Provides a property value converter for unspecified datetime property editors.
Namespace: Umbraco.Cms.Core.PropertyEditors.ValueConverters
Assembly: Umbraco.Infrastructure.dll
Syntax
public class DateTimeUnspecifiedValueConverter : 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 SourceDateTimeUnspecifiedValueConverter(IJsonSerializer, ILogger<DateTimeUnspecifiedValueConverter>)
Initializes a new instance of the DateTimeUnspecifiedValueConverter class.
Declaration
public DateTimeUnspecifiedValueConverter(IJsonSerializer jsonSerializer, ILogger<DateTimeUnspecifiedValueConverter> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| IJsonSerializer | jsonSerializer | |
| ILogger<DateTimeUnspecifiedValueConverter> | logger |
Methods
View SourceConvertToObject(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. |
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.
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. |