Class DateFormatValidationRule
Validation rule for date format.
[Obsolete("Use 'DateTimeFormatValidationRule' instead.")]
[ObsoleteSince(29, 1)]
public sealed class DateFormatValidationRule : ValidationRule<DateFormatValidationRuleProperties, DateFormatValidationRuleClientProperties, DateTime?>, IValidationRule
- Inheritance
-
objectValidationRule<DateFormatValidationRuleProperties, DateFormatValidationRuleClientProperties, DateTime?>DateFormatValidationRule
- Implements
- Inherited Members
- Extension Methods
Constructors
DateFormatValidationRule(ILocalizationService, string)
Creates a new instance of DateFormatValidationRule class.
public DateFormatValidationRule(ILocalizationService localizationService, string dateFormat)
Parameters
localizationService
ILocalizationServicedateFormat
string
Properties
ClientRuleName
Gets the client rule name identifier.
public override string ClientRuleName { get; }
Property Value
- string
DefaultErrorMessage
Defines default error message of the validation rule.
protected override string DefaultErrorMessage { get; }
Property Value
- string
Methods
Validate(DateTime?, IFormFieldValueProvider)
Validates value
and returns the validation result.
public override Task<ValidationResult> Validate(DateTime? value, IFormFieldValueProvider formFieldValueProvider)
Parameters
value
DateTime?formFieldValueProvider
IFormFieldValueProvider
Returns
- Task<ValidationResult>
Returns Success as invalid value cannot be deserialized.