FIX: do not automatically infere date type (#6127)

This commit is contained in:
Joffrey JAFFEUX 2018-07-20 09:35:14 -04:00 committed by GitHub
parent 9d919406c4
commit 3fdc4f2df1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -61,11 +61,10 @@ const Report = Discourse.Model.extend({
formatedValue: number(value)
});
if (type !== "string" && type !== "text") {
if (type === "date") {
const date = moment(value, "YYYY-MM-DD");
if (type === "date" || date.isValid()) {
if (date.isValid()) {
return _.assign(base, {
type: "date",
formatedValue: date.format("LL")
});
}