From b5d1f31fe4714a6a6233e4c1ff50c0bfd1580708 Mon Sep 17 00:00:00 2001 From: markus-moser Date: Mon, 10 Jun 2024 17:41:48 +0200 Subject: [PATCH] Fix edit in grid for date fields with date column type --- public/js/pimcore/object/tags/date.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/public/js/pimcore/object/tags/date.js b/public/js/pimcore/object/tags/date.js index d291ae8cfa..b0d704e6e2 100644 --- a/public/js/pimcore/object/tags/date.js +++ b/public/js/pimcore/object/tags/date.js @@ -50,8 +50,13 @@ pimcore.object.tags.date = Class.create(pimcore.object.tags.abstract, { } if (value) { - var timestamp = intval(value) * 1000; - var date = new Date(timestamp); + let date; + if (typeof value === "string" && value.match(/-/)) { + date = new Date(value); + } else { + let timestamp = intval(value) * 1000; + date = new Date(timestamp); + } return Ext.Date.format(date, "Y-m-d"); } @@ -118,6 +123,9 @@ pimcore.object.tags.date = Class.create(pimcore.object.tags.abstract, { }, getCellEditValue: function () { + if (this.fieldConfig.columnType === "date") { + return this.getValue(); + } return this.getValue() / 1000; },