Hi,
I used the generator and created two entries
valid from
valid until
with the German date format "dd.MM.yy".
It works fine for the online preview.
Starting the project leads to the following situation, http://prntscr.com/hvjjxp , where it is possible to store a date like 01.01.18, but not 10.01.18.
The POST request includes
data[0][gueltig_von] 01.01.18
data[0][gueltig_bis] 10.01.18
The result is
{
"draw":null,
"data":[
],
"recordsTotal":null,
"recordsFiltered":null,
"error":null,
"fieldErrors":[
{
"name":"gueltig_bis",
"status":"Input not valid"
}
],
"id":null,
"meta":{
},
"options":{
},
"files":{
},
"upload":{
"id":null
},
"debugSql":[
],
"cancelled":[
]
}
debugSql is empty, also I set
.Debug(true)
in the Controller.cs
The validation in the Controller.cs is
.Field(new Field("gueltig_von")
.Validator(Validation.DateFormat("dd.MM.yy"))
.GetFormatter(Format.DateSqlToFormat("dd.MM.yy"))
.SetFormatter(Format.DateFormatToSql("dd.MM.yy"))
)
.Field(new Field("gueltig_bis")
.Validator(Validation.DateFormat("dd.MM.yy"))
.GetFormatter(Format.DateSqlToFormat("dd.MM.yy"))
.SetFormatter(Format.DateFormatToSql("dd.MM.yy"))
)
The type of both dates are "date" in the MS SQL SERVER.
I suspect that there is an error in the validation for the German date format.
All the best,
Markus