diff --git a/composer.json b/composer.json index 922ed5e307..c47cc75503 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "php": "~8.1.0 || ~8.2.0 || ~8.3.0", "cbschuld/browser.php": "^1.9.6", "phpoffice/phpspreadsheet": "^1.24 || ^2.1", - "pimcore/pimcore": "^11.3.0", + "pimcore/pimcore": "11.3.0-RC1", "symfony/webpack-encore-bundle": "^1.13.2" }, "require-dev": { diff --git a/public/js/pimcore/asset/helpers/grid.js b/public/js/pimcore/asset/helpers/grid.js index 30d5b8e736..9ba14089e2 100644 --- a/public/js/pimcore/asset/helpers/grid.js +++ b/public/js/pimcore/asset/helpers/grid.js @@ -230,7 +230,7 @@ pimcore.asset.helpers.grid = Class.create({ locked: this.getColumnLock(field), renderer: function (d) { var date = new Date(d * 1000); - return Ext.Date.format(date, "Y-m-d H:i:s"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); } }); } else if (key == "filename") { diff --git a/public/js/pimcore/asset/helpers/gridConfigDialog.js b/public/js/pimcore/asset/helpers/gridConfigDialog.js index 1500a9f8b4..9e96f4b51a 100644 --- a/public/js/pimcore/asset/helpers/gridConfigDialog.js +++ b/public/js/pimcore/asset/helpers/gridConfigDialog.js @@ -365,7 +365,7 @@ pimcore.asset.helpers.gridConfigDialog = Class.create(pimcore.element.helpers.gr } else if ((key == "modificationDate" || key == "creationDate") && value) { var timestamp = intval(value) * 1000; var date = new Date(timestamp); - return Ext.Date.format(date, "Y-m-d H:i"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getShortDateTimeFormat()); } else { var fieldType = record.data.dataType; diff --git a/public/js/pimcore/asset/listfolder.js b/public/js/pimcore/asset/listfolder.js index d84de0aba5..6ef8cb948a 100644 --- a/public/js/pimcore/asset/listfolder.js +++ b/public/js/pimcore/asset/listfolder.js @@ -374,7 +374,7 @@ pimcore.asset.listfolder = Class.create(pimcore.asset.helpers.gridTabAbstract, { gridColumns.push({text: t(field.label), width: this.getColumnWidth(field, 150), sortable: true, dataIndex: field.key, editable: false, filter: 'date', renderer: function(d) { var date = new Date(d * 1000); - return Ext.Date.format(date, "Y-m-d H:i:s"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); } }); } else if (key == "filename") { @@ -396,7 +396,7 @@ pimcore.asset.listfolder = Class.create(pimcore.asset.helpers.gridTabAbstract, { renderer: function(d) { if (d) { var date = new Date(d * 1000); - return Ext.Date.format(date, "Y-m-d"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getShortDateFormat()); } } diff --git a/public/js/pimcore/asset/metadata/tags/date.js b/public/js/pimcore/asset/metadata/tags/date.js index ad34e5bd1c..9d166fbdff 100644 --- a/public/js/pimcore/asset/metadata/tags/date.js +++ b/public/js/pimcore/asset/metadata/tags/date.js @@ -45,7 +45,7 @@ pimcore.asset.metadata.tags.date = Class.create(pimcore.asset.metadata.tags.abst var timestamp = intval(value) * 1000; var date = new Date(timestamp); - return Ext.Date.format(date, "Y-m-d"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getShortDateFormat()); } return ""; }.bind(this, field.key) @@ -63,7 +63,6 @@ pimcore.asset.metadata.tags.date = Class.create(pimcore.asset.metadata.tags.abst name:this.fieldConfig.name, componentCls:"object_field", width:130, - format: "Y-m-d" }; if (this.fieldConfig.labelWidth) { @@ -96,9 +95,7 @@ pimcore.asset.metadata.tags.date = Class.create(pimcore.asset.metadata.tags.abst }, getGridCellEditor: function (gridtype, record) { - return Ext.create('Ext.form.field.Date', { - format: "Y-m-d" - }); + return Ext.create('Ext.form.field.Date'); }, convertPredefinedGridData: function(v, r) { @@ -114,7 +111,7 @@ pimcore.asset.metadata.tags.date = Class.create(pimcore.asset.metadata.tags.abst if(!(value instanceof Date)) { value = new Date(value * 1000); } - return Ext.Date.format(value, "Y-m-d"); + return Ext.Date.format(value, pimcore.globalmanager.get('localeDateTime').getShortDateFormat()); } return Ext.util.Format.htmlEncode(value); diff --git a/public/js/pimcore/asset/versions.js b/public/js/pimcore/asset/versions.js index d9a5fd8ee0..dfa74a0179 100644 --- a/public/js/pimcore/asset/versions.js +++ b/public/js/pimcore/asset/versions.js @@ -92,14 +92,14 @@ pimcore.asset.versions = Class.create({ return ""; }.bind(this), editable: false}, {text: t("date"), width:150, sortable: true, dataIndex: 'date', filter: 'date', renderer: function(d) { - return Ext.Date.format(d, "Y-m-d H:i:s"); + return Ext.Date.format(d, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); }}, {text: "ID", sortable: true, dataIndex: 'id', editable: false, width: 60}, {text: t("user"), sortable: true, dataIndex: 'name', filter: 'list'}, {text: t("scheduled"), width:130, sortable: true, dataIndex: 'scheduled', renderer: function(d) { if (d != null){ var date = new Date(d * 1000); - return Ext.Date.format(date, "Y-m-d H:i:s"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); } }, editable: false}, {text: t("note"), sortable: true, dataIndex: 'note', editor: new Ext.form.TextField(), filter: 'string', renderer: Ext.util.Format.htmlEncode} diff --git a/public/js/pimcore/document/editables/scheduledblock.js b/public/js/pimcore/document/editables/scheduledblock.js index 6114ae46bc..b5ebd70054 100644 --- a/public/js/pimcore/document/editables/scheduledblock.js +++ b/public/js/pimcore/document/editables/scheduledblock.js @@ -103,7 +103,7 @@ pimcore.document.editables.scheduledblock = Class.create(pimcore.document.editab var timestamp = new Date(element.date * 1000); jumpMenuEntries.push({ - text: Ext.Date.format(timestamp, 'Y-m-d H:i'), + text: Ext.Date.format(timestamp, pimcore.globalmanager.get('localeDateTime').getShortDateTimeFormat()), iconCls: 'pimcore_icon_time', handler: function(element, timestamp) { this.dateField.setValue(timestamp); diff --git a/public/js/pimcore/document/pages/preview.js b/public/js/pimcore/document/pages/preview.js index d3cc25acb2..bc06b86fd9 100644 --- a/public/js/pimcore/document/pages/preview.js +++ b/public/js/pimcore/document/pages/preview.js @@ -124,8 +124,8 @@ Ext.define('pimcore.document.pages.preview', { width: '100%', cls: 'pimcore_document_preview_timeslider', tipText: function(thumb){ - var date = new Date(thumb.value * 1000); - return Ext.Date.format(date, 'H:i'); + const date = new Date(thumb.value * 1000); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getShortTimeFormat()); }, listeners: { change: function(field, newValue, oldValue) { diff --git a/public/js/pimcore/document/settings_abstract.js b/public/js/pimcore/document/settings_abstract.js index b633c0efbf..232a010a5c 100644 --- a/public/js/pimcore/document/settings_abstract.js +++ b/public/js/pimcore/document/settings_abstract.js @@ -344,7 +344,7 @@ pimcore.document.settings_abstract = Class.create({ if (this.document.data.staticLastGenerated) { const date = new Date(this.document.data.staticLastGenerated * 1000); - lastGenerated = Ext.Date.format(date, "Y-m-d H:i"); + lastGenerated = Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getShortDateTimeFormat()); }else{ lastGenerated = t('never'); } diff --git a/public/js/pimcore/document/versions.js b/public/js/pimcore/document/versions.js index 3c19ceac88..6008fb3be1 100644 --- a/public/js/pimcore/document/versions.js +++ b/public/js/pimcore/document/versions.js @@ -125,7 +125,7 @@ pimcore.document.versions = Class.create({ }, { text: t("date"), width: 150, sortable: true, dataIndex: 'date', filter: 'date', renderer: function (d) { - return Ext.Date.format(d, "Y-m-d H:i:s"); + return Ext.Date.format(d, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); }, editable: false }, {text: "ID", sortable: true, dataIndex: 'id', editable: false, width: 60}, @@ -138,7 +138,7 @@ pimcore.document.versions = Class.create({ renderer: function (d) { if (d != null) { var date = new Date(d * 1000); - return Ext.Date.format(date, "Y-m-d H:i:s"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); } return d; }, diff --git a/public/js/pimcore/element/helpers/gridColumnConfig.js b/public/js/pimcore/element/helpers/gridColumnConfig.js index dc8b0018fc..5a45f106d8 100644 --- a/public/js/pimcore/element/helpers/gridColumnConfig.js +++ b/public/js/pimcore/element/helpers/gridColumnConfig.js @@ -237,7 +237,7 @@ pimcore.element.helpers.gridColumnConfig = { var value = filterData[i].getValue(); if (value instanceof Date) { - value = Ext.Date.format(value, "Y-m-d"); + value = Ext.Date.format(value, pimcore.globalmanager.get('localeDateTime').getShortDateFormat()); } if (value && typeof value == "object") { diff --git a/public/js/pimcore/element/note_details.js b/public/js/pimcore/element/note_details.js index af9944ef54..59055c2511 100644 --- a/public/js/pimcore/element/note_details.js +++ b/public/js/pimcore/element/note_details.js @@ -124,7 +124,7 @@ pimcore.element.note_details = Class.create({ xtype: "textfield", fieldLabel: t('date'), readOnly: true, - value: Ext.Date.format(date, "Y-m-d H:i:s") + value: Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()) } ); diff --git a/public/js/pimcore/element/notes.js b/public/js/pimcore/element/notes.js index ce6aec4403..872d118cfe 100644 --- a/public/js/pimcore/element/notes.js +++ b/public/js/pimcore/element/notes.js @@ -139,7 +139,7 @@ pimcore.element.notes = Class.create({ }}, {text: t("date"), sortable: true, dataIndex: 'date', flex: 100, filter: 'date', renderer: function(d) { var date = new Date(d * 1000); - return Ext.Date.format(date, "Y-m-d H:i:s"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); }} ]; @@ -291,7 +291,7 @@ pimcore.element.notes = Class.create({ } else if (record.get("type") == "date") { if(value) { var date = new Date(value * 1000); - return Ext.Date.format(date, "Y-m-d H:i:s"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); } } diff --git a/public/js/pimcore/element/scheduler.js b/public/js/pimcore/element/scheduler.js index da9562feb1..d600f73d58 100644 --- a/public/js/pimcore/element/scheduler.js +++ b/public/js/pimcore/element/scheduler.js @@ -43,7 +43,7 @@ pimcore.element.scheduler = Class.create({ td = [ rawTask.id, d, - Ext.Date.format(d, "H:i"), + Ext.Date.format(d, pimcore.globalmanager.get('localeDateTime').getShortTimeFormat()), rawTask.action ]; @@ -63,7 +63,7 @@ pimcore.element.scheduler = Class.create({ convert: function (v, rec) { var ret = v; if (v instanceof Date) { - ret = Ext.Date.format(v, "Y-m-d"); + ret = Ext.Date.format(v, pimcore.globalmanager.get('localeDateTime').getShortDateFormat()); } return ret; } @@ -73,7 +73,7 @@ pimcore.element.scheduler = Class.create({ convert: function (v, rec) { var ret = v; if (v instanceof Date) { - ret = Ext.Date.format(v, "H:i"); + ret = Ext.Date.format(v, pimcore.globalmanager.get('localeDateTime').getShortTimeFormat()); } return ret; } @@ -112,7 +112,7 @@ pimcore.element.scheduler = Class.create({ fields: ['id', {name: 'date', convert: function (v, rec) { var d = new Date(intval(v) * 1000); - var ret = Ext.Date.format(d, "Y-m-d H:i"); + var ret = Ext.Date.format(d, pimcore.globalmanager.get('localeDateTime').getShortDateTimeFormat()); if (rec.data.note) { ret += " - " + rec.data.note; @@ -141,12 +141,9 @@ pimcore.element.scheduler = Class.create({ }); var propertiesColumns = [ - {text: t("date"), width: 120, sortable: true, dataIndex: 'date', editor: new Ext.form.DateField({ - format: "Y-m-d" - }) + {text: t("date"), width: 120, sortable: true, dataIndex: 'date', editor: new Ext.form.DateField() }, {text: t("time"), width: 100, sortable: true, dataIndex: 'time', editor: new Ext.form.TimeField({ - format: "H:i", listeners: { focus : function(component) { component.setValue(Ext.util.Format.htmlDecode(component.value)); diff --git a/public/js/pimcore/layout/portlets/modifiedAssets.js b/public/js/pimcore/layout/portlets/modifiedAssets.js index 503d776880..029d94669e 100644 --- a/public/js/pimcore/layout/portlets/modifiedAssets.js +++ b/public/js/pimcore/layout/portlets/modifiedAssets.js @@ -52,7 +52,7 @@ pimcore.layout.portlets.modifiedAssets = Class.create(pimcore.layout.portlets.ab {text: t('path'), sortable: false, dataIndex: 'path', flex: 1}, {text: t('date'), width: 150, sortable: false, renderer: function (d) { var date = new Date(d * 1000); - return Ext.Date.format(date,"Y-m-d H:i:s"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); }, dataIndex: 'date'} ], stripeRows: true, diff --git a/public/js/pimcore/layout/portlets/modifiedDocuments.js b/public/js/pimcore/layout/portlets/modifiedDocuments.js index c858115e46..3504635a66 100644 --- a/public/js/pimcore/layout/portlets/modifiedDocuments.js +++ b/public/js/pimcore/layout/portlets/modifiedDocuments.js @@ -52,7 +52,7 @@ pimcore.layout.portlets.modifiedDocuments = Class.create(pimcore.layout.portlets {text: t('path'), sortable: false, dataIndex: 'path', flex: 1}, {text: t('date'), width: 150, sortable: false, renderer: function (d) { var date = new Date(d * 1000); - return Ext.Date.format(date,"Y-m-d H:i:s"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); }, dataIndex: 'date'} ], diff --git a/public/js/pimcore/layout/portlets/modifiedObjects.js b/public/js/pimcore/layout/portlets/modifiedObjects.js index 07d47df6d8..0ee6c9649d 100644 --- a/public/js/pimcore/layout/portlets/modifiedObjects.js +++ b/public/js/pimcore/layout/portlets/modifiedObjects.js @@ -53,7 +53,7 @@ pimcore.layout.portlets.modifiedObjects = Class.create(pimcore.layout.portlets.a {text: t('path'), sortable: false, dataIndex: 'path', flex: 1}, {text: t('date'), width: 150, sortable: false, renderer: function (d) { var date = new Date(d * 1000); - return Ext.Date.format(date,"Y-m-d H:i:s"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); }, dataIndex: 'date'} ], diff --git a/public/js/pimcore/localeDateTime.js b/public/js/pimcore/localeDateTime.js new file mode 100644 index 0000000000..c681e5dc57 --- /dev/null +++ b/public/js/pimcore/localeDateTime.js @@ -0,0 +1,154 @@ +/** + * Pimcore + * + * This source file is available under two different licenses: + * - GNU General Public License version 3 (GPLv3) + * - Pimcore Commercial License (PCL) + * Full copyright and license information is available in + * LICENSE.md which is distributed with this source code. + * + * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) + * @license http://www.pimcore.org/license GPLv3 and PCL + */ + +pimcore.registerNS("pimcore.localeDateTime"); + +pimcore.localeDateTime = { + shortDate: 'Y-m-d', + shortTime: 'H:i', // Short time is without seconds + mediumTime: 'H:i:s', + systemShortDate: 'Y-m-d', + systemShortTime: 'H:i', + systemMediumTime: 'H:i:s', + + getShortDateFormat: function () { + return this.shortDate; + }, + getShortTimeFormat: function () { + return this.shortTime; + }, + getMediumTimeFormat: function () { + return this.mediumTime; + }, + getShortDateTimeFormat: function () { + return this.shortDate + ' ' + this.shortTime; + }, + getDateTimeFormat: function () { + return this.shortDate + ' ' + this.mediumTime; + }, + + // Set the default date and time format based on the given locale and override forms/fields globally + setDefaultDateTime: function (locale) { + if (locale) { + this.shortDate = this.convertDateFormatFromIntl(locale); + this.shortTime = this.convertTimeFroamtFromIntl(locale, 'short'); + this.mediumTime = this.convertTimeFroamtFromIntl(locale, 'medium'); + } + + if (Ext.util && Ext.util.Format) { + Ext.apply(Ext.util.Format, { + dateFormat: this.getShortDateFormat() + }) + } + Ext.override(Ext.form.field.Date, { + format: this.getShortDateFormat(), + }); + + Ext.override(Ext.grid.column.Date, { + format: this.getShortDateFormat(), + }); + + Ext.override(Ext.form.field.Time, { + format: this.getShortTimeFormat(), + }); + }, + + // Returns the EXT JS date format equivalent based on the localized date by Intl.DateTimeFormat + // It checks wheter it is leading zero or 4 digits years by guessing it by checking the output of a dummy date + convertDateFormatFromIntl: function (locale) { + const dateFormatter = new Intl.DateTimeFormat(locale, {dateStyle: "short"}); + const localizedDate = dateFormatter.format(new Date('2021-06-03')); + let dayFormat = 'j'; //no leading zero + let monthFormat = 'n'; //no leading zero + let yearFormat = 'y'; // 2 digits year + + if (localizedDate.includes('2021')) { + yearFormat = 'Y'; + } + if (localizedDate.includes('03')) { + dayFormat = 'd'; + } + if (localizedDate.includes('06')) { + monthFormat = 'm'; + } + + const getPatternForPart = (part) => { + switch (part.type) { + case 'day': + return dayFormat; + case 'month': + return monthFormat; + case 'year': + return yearFormat; + case 'literal': + return part.value; + default: + console.log('Unsupported date part', part); + return ''; + } + }; + return dateFormatter.formatToParts() + .map(getPatternForPart) + .join(''); + }, + + // Returns the EXT JS time format equivalent based on the localized date by Intl.DateTimeFormat + // It checks wheter it is 0-12 AM/PM, 0-23. Minutes and seconds are internationally with a leading zero as 00-59. + convertTimeFroamtFromIntl: function (locale, timeStyle) { + const dummyDate = new Date('2020-01-01 09:30:59'); + const dateFormatter = new Intl.DateTimeFormat(locale, {timeStyle: timeStyle}); + const localizedDateTime = dateFormatter.format(dummyDate); + + let dayPeriodFormat = ''; + if (localizedDateTime.includes('am') || localizedDateTime.includes('a.m.')) { //lowecased eg. am/pm + dayPeriodFormat = 'a'; + } else if (localizedDateTime.includes('AM') || localizedDateTime.includes('A.M.')) { + dayPeriodFormat = 'A'; + } + + let hourFormat = ''; + if (localizedDateTime.includes('09')) { + hourFormat = 'H'; + if (dayPeriodFormat) { + hourFormat = 'h'; + } + } else if (localizedDateTime.includes('9')) { + hourFormat = 'G'; + if (dayPeriodFormat) { + hourFormat = 'g'; + } + } + + const getPatternForPart = (part) => { + switch (part.type) { + case 'hour': + return hourFormat; + case 'minute': + return 'i'; + case 'second': + return 's'; + case 'dayPeriod': + return dayPeriodFormat; + case 'literal': + return part.value; + default: + console.log('Unsupported date part', part); + return ''; + } + }; + + return dateFormatter.formatToParts() + .map(getPatternForPart) + .join(''); + } +}; diff --git a/public/js/pimcore/notification/panel.js b/public/js/pimcore/notification/panel.js index 2c109715ab..b85d5bfb8b 100644 --- a/public/js/pimcore/notification/panel.js +++ b/public/js/pimcore/notification/panel.js @@ -94,7 +94,7 @@ pimcore.notification.panel = Class.create({ { header: t("date"), flex: 3, sortable: true, filter: 'date', dataIndex: 'timestamp', renderer: function(d) { - return Ext.Date.format(new Date(d*1000), "Y-m-d H:i:s"); + return Ext.Date.format(new Date(d*1000), pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); } }, { diff --git a/public/js/pimcore/object/classes/data/datetime.js b/public/js/pimcore/object/classes/data/datetime.js index 90ce0bb482..ca6e61b107 100644 --- a/public/js/pimcore/object/classes/data/datetime.js +++ b/public/js/pimcore/object/classes/data/datetime.js @@ -98,7 +98,7 @@ pimcore.object.classes.data.datetime = Class.create(pimcore.object.classes.data. } date.value = tmpDate; - time.value = Ext.Date.format(tmpDate, "H:i"); + time.value = Ext.Date.format(tmpDate, pimcore.globalmanager.get('localeDateTime').getShortTimeFormat()); } var datefield = new Ext.form.DateField(date); @@ -195,10 +195,10 @@ pimcore.object.classes.data.datetime = Class.create(pimcore.object.classes.data. setDefaultValue:function (defaultValue, datefield, timefield) { if (datefield.getValue() && typeof datefield.getValue() === 'object') { - var dateString = Ext.Date.format(datefield.getValue(), "Y-m-d"); + var dateString = Ext.Date.format(datefield.getValue(), pimcore.globalmanager.get('localeDateTime').getShortDateFormat()); if (timefield.getValue()) { - dateString += " " + Ext.Date.format(timefield.getValue(), "H:i"); + dateString += " " + Ext.Date.format(timefield.getValue(), pimcore.globalmanager.get('localeDateTime').getShortTimeFormat()); } else { dateString += " 00:00"; } diff --git a/public/js/pimcore/object/classificationstore/collectionsPanel.js b/public/js/pimcore/object/classificationstore/collectionsPanel.js index c27504cc83..93230d398d 100644 --- a/public/js/pimcore/object/classificationstore/collectionsPanel.js +++ b/public/js/pimcore/object/classificationstore/collectionsPanel.js @@ -281,7 +281,7 @@ pimcore.object.classificationstore.collectionsPanel = Class.create({ var dateRenderer = function(d) { if (d !== undefined) { var date = new Date(d * 1000); - return Ext.Date.format(date, "Y-m-d H:i:s"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); } else { return ""; } diff --git a/public/js/pimcore/object/classificationstore/groupsPanel.js b/public/js/pimcore/object/classificationstore/groupsPanel.js index 5a28d8c267..a6890076ef 100644 --- a/public/js/pimcore/object/classificationstore/groupsPanel.js +++ b/public/js/pimcore/object/classificationstore/groupsPanel.js @@ -289,7 +289,7 @@ pimcore.object.classificationstore.groupsPanel = Class.create({ var dateRenderer = function(d) { if (d !== undefined) { var date = new Date(d * 1000); - return Ext.Date.format(date, "Y-m-d H:i:s"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); } else { return ""; } diff --git a/public/js/pimcore/object/classificationstore/propertiesPanel.js b/public/js/pimcore/object/classificationstore/propertiesPanel.js index 10a49af795..4ae74e1552 100644 --- a/public/js/pimcore/object/classificationstore/propertiesPanel.js +++ b/public/js/pimcore/object/classificationstore/propertiesPanel.js @@ -168,7 +168,7 @@ pimcore.object.classificationstore.propertiespanel = Class.create({ var dateRenderer = function(d) { if (d !== undefined) { var date = new Date(d * 1000); - return Ext.Date.format(date, "Y-m-d H:i:s"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); } else { return ""; } diff --git a/public/js/pimcore/object/helpers/grid.js b/public/js/pimcore/object/helpers/grid.js index d5919330ba..3731518d0b 100644 --- a/public/js/pimcore/object/helpers/grid.js +++ b/public/js/pimcore/object/helpers/grid.js @@ -336,13 +336,13 @@ pimcore.object.helpers.grid = Class.create({ } else if(field.key == "creationDate") { gridColumns.push({text: t("creationdate") + " (System)", width: this.getColumnWidth(field, 160), sortable: true, dataIndex: "creationDate", filter: 'date', editable: false, locked: this.getColumnLock(field), renderer: function(d) { - return Ext.Date.format(d, "Y-m-d H:i:s"); + return Ext.Date.format(d, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); }/*, hidden: !propertyVisibility.creationDate*/}); } else if(field.key == "modificationDate") { gridColumns.push({text: t("modificationdate") + " (System)", width: this.getColumnWidth(field, 160), sortable: true, dataIndex: "modificationDate", filter: 'date', editable: false, locked: this.getColumnLock(field), renderer: function(d) { - return Ext.Date.format(d, "Y-m-d H:i:s"); + return Ext.Date.format(d, pimcore.globalmanager.get('localeDateTime').getDateTimeFormat()); }/*, hidden: !propertyVisibility.modificationDate*/}); } else { if (fields[i].isOperator) { diff --git a/public/js/pimcore/object/helpers/gridConfigDialog.js b/public/js/pimcore/object/helpers/gridConfigDialog.js index 06ee1008db..e30c9486bc 100644 --- a/public/js/pimcore/object/helpers/gridConfigDialog.js +++ b/public/js/pimcore/object/helpers/gridConfigDialog.js @@ -299,7 +299,7 @@ pimcore.object.helpers.gridConfigDialog = Class.create(pimcore.element.helpers.g if (key == "modificationDate" || key == "creationDate") { var timestamp = intval(value) * 1000; var date = new Date(timestamp); - return Ext.Date.format(date, "Y-m-d H:i"); + return Ext.Date.format(date, pimcore.globalmanager.get('localeDateTime').getShortDateTimeFormat()); } else if (key == "published") { return Ext.String.format('