Class PropertyDate
Property representing a System.DateTime value.
Inherited Members
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 12.0.3Syntax
public class PropertyDate : PropertyData, IReadOnly<PropertyData>, IReadOnly
Remarks
This class will render a date selector when put in edit mode using the EPiServer.Web.WebControls.Property webcontrol.
Constructors
PropertyDate()
Initializes a new instance of the PropertyDate class.
Declaration
public PropertyDate()
PropertyDate(DateTime)
Initializes a new instance of the PropertyDate class.
Declaration
public PropertyDate(DateTime date)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | date | The initial value. |
Properties
Date
Gets or sets the value as a nullable System.DateTime.
Declaration
public Nullable<DateTime> Date { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> | The value as a nullable System.DateTime. |
MaxValue
Gets the highest value that can be saved.
Declaration
public static DateTime MaxValue { get; }
Property Value
Type | Description |
---|---|
System.DateTime | The highest value that can be saved. |
Remarks
The highest value is currently 9999-12-31.
MinValue
Gets the lowest value that can be saved.
Declaration
public static DateTime MinValue { get; }
Property Value
Type | Description |
---|---|
System.DateTime | The lowest value that can be saved. |
Remarks
The lowest value is currently 1753-01-01.
PropertyValueType
Gets the System.Type of the property value.
Declaration
public override Type PropertyValueType { get; }
Property Value
Type | Description |
---|---|
System.Type | The System.Type of the property value. |
Overrides
Type
Property type as defined by enum PropertyDataType.
Declaration
public override PropertyDataType Type { get; }
Property Value
Type | Description |
---|---|
PropertyDataType | The type as defined by enum PropertyDataType. |
Overrides
Value
Gets or sets the value of the property.
Declaration
public override object Value { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The value of the property. |
Overrides
Remarks
Value returns null if the property has no value defined.
Methods
IsValidDate(DateTime)
Determines whether [is valid date] [the specified date].
Declaration
public static bool IsValidDate(DateTime date)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | date | The date. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Parse(String)
Creates a PropertyDate from a string.
Declaration
public static PropertyDate Parse(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The string to create a PropertyDate from. |
Returns
Type | Description |
---|---|
PropertyDate | A PropertyDate. |
Remarks
If the string is null or Empty an empty PropertyDate is returned. If the string cannot be parsed as a System.DateTime an InvalidPropertyValueException is thrown.
ParseToSelf(String)
Sets the value of the property to the parsed value.
Declaration
public override void ParseToSelf(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The string to create a PropertyDate from. |
Overrides
Remarks
If the string is null or Empty an empty PropertyDate is returned. If the string cannot be parsed as a System.DateTime an InvalidPropertyValueException is thrown.
SetDefaultValue()
Sets the default value for this property.
Declaration
protected override void SetDefaultValue()