Date validation or NULL
Date validation or NULL
lm0@logic1.com.au
Posts: 11Questions: 3Answers: 0
in Editor
I need validate the date OR accept a null, currently I have :
.Field(new Field("DeliveryDate").Validator(Validation.DateFormat(
Format.DATE_ISO_8601,
new ValidationOpts { Message = "Please enter a date in the format yyyy-mm-dd" }
))
.GetFormatter(Format.DateSqlToFormat(Format.DATE_ISO_8601))
.SetFormatter(Format.DateFormatToSql(Format.DATE_ISO_8601))
)
I have added Format.NullEmpty() but cant get this to work,
Any recommendations please?
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Hi,
Currently what you need to do is provide a custom method to perform this action. For example:
Unfortunately I think there is a bug in the current release in this area. Editor 1.4.1 will be released tomorrow with the fix, or I can send you the updated dll if you need it sooner.
What I think I'll do is add the ability to provide multiple formatters so you would be able to do:
It is very tempting to put that into 1.4.1, but I should wrap everything else for the release up first before adding new things! It might be in the following release...
Allan
Thank you for fast response,
I have tried the custom method and get ->
"The parameterized query '(@DeliveryDate nvarchar(4000),@Rego nvarchar(6),@ClaimNumber nva' expects the parameter '@DeliveryDate', which was not supplied."
I presume this is the bug that will be fixed in 1.41 this week.
I get the same error using Format.NullEmpty() on decimal fields.
I will retry in 1.41
Yup - that's the one! Sorry about the bug - 1.4.1 will fix it!
Allan