Format.DateFormat does not compile, what am I missing?
Format.DateFormat does not compile, what am I missing?

Hello, I'm new to Editor. I'm working with c#, .NET, MVC, and MS SQL. I used Generator to create a time field (no date). In the controller code, Generator created:
var response = new Editor(db, "test", "id")
.Model<TestModel>()
.Field(new Field("time1")
.Validator(Validation.DateFormat("HH:mm"))
.GetFormatter(Format.DateFormat("HH:mm:ss", "HH:mm"))
.SetFormatter(Format.DateFormat("HH:mm", "HH:mm:ss"))
)
But it doesn't compile with the error: 'Format' does not contain a definition for DateFormat. I have a reference to the DataTables.dll, so everything else complies. And it works if I click Run Now from Generator. What am I missing?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Could you try using
DataTables.Format.DateFormat
please? I wonder if there might be a conflict with another class happening?Thanks,
Allan
HI Allan,
Sorry for the delay, I got a little sidetracked.
I tried changing the code to:
But autocomplete couldn't find DateFormat after DataTables.Format. Autocomplete had other methods, like DateSqlToFormat for example.
I have v1.5.6 of DataTables.dll. That's what was included when I downloaded Editor.
Thanks!
Apologies, it is
DateTime
rather thanDateFormat
. So:Allan
That compiled, and it gets me a lot closer to understanding to it all works. Thanks!