I'm building an API with LoopBack 4, and in a model there is a property called "day" which is a Date type (the MySQL column is also type Date).
But I can't post values like "2019-09-09" to it, because it wants something like "2019-09-09T12:41:05.942Z". How can I specify that it has to be a date (without time)?
I'm confused because you can pass "2019-09-09" in query parameters (that are of type date), but not in models.
I currently have the property in the model like this:
@property({
type: Date,
required: true,
mysql: {
columnName: 'day',
dataType: 'date',
dataLength: null,
dataPrecision: null,
dataScale: null,
nullable: 'N',
},
})
day: Date;
Expected: accept "2019-09-09" as value
Actually: 422: day should match format "date-time"