init
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Kreta.Naplo.Domain.V3.Utility.ValidationAttributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
internal sealed class ShortDateTimeAttribute : ValidationAttribute
|
||||
{
|
||||
public override bool IsValid(object value)
|
||||
{
|
||||
DateTime? timePropertyValue = value as DateTime?;
|
||||
|
||||
return !timePropertyValue.HasValue || timePropertyValue.Value - timePropertyValue.Value.Date == new TimeSpan(0);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user