[DateType]
IntelliTect.Coalesce.DataAnnotations.DateTypeAttribute
WARNING
This attribute is deprecated and not recommended for use in new development. Instead, use the native .NET types System.DateOnly
and System.TimeOnly
.
Specifies whether a DateTime type will have a date and a time, or only a date.
Example Usage
c#
public class Person
{
public int PersonId { get; set; }
[DateType(DateTypeAttribute.DateTypes.DateOnly)]
public DateTimeOffset? BirthDate { get; set; }
}
Properties
// Also settable via constructor parameter #1
public DateTypes DateType { get; set; } = DateTypes.DateTime;
// Also settable via constructor parameter #1
public DateTypes DateType { get; set; } = DateTypes.DateTime;
The type of date the property represents.
Enum values are:
DateTypeAttribute.DateTypes.DateTime
Subject is both a date and time.DateTypeAttribute.DateTypes.DateOnly
Subject is only a date with no significant time component.DateTypeAttribute.DateTypes.TimeOnly
Subject is only a time with no significant date component.