diff --git a/public/js/pimcore/asset/versions.js b/public/js/pimcore/asset/versions.js index dfa74a0179..b26bfc30bd 100644 --- a/public/js/pimcore/asset/versions.js +++ b/public/js/pimcore/asset/versions.js @@ -155,7 +155,10 @@ pimcore.asset.versions = Class.create({ var data = grid.getStore().getAt(rowIndex).data; var versionId = data.id; - var url = Routing.generate('pimcore_admin_asset_showversion', {id: versionId}); + var url = Routing.generate('pimcore_admin_asset_showversion', { + id: versionId, + userTimezone: getUserTimezone() + }); Ext.get(this.frameId).dom.src = url; }, diff --git a/public/js/pimcore/element/helpers/gridColumnConfig.js b/public/js/pimcore/element/helpers/gridColumnConfig.js index 5a45f106d8..42d3b4cf51 100644 --- a/public/js/pimcore/element/helpers/gridColumnConfig.js +++ b/public/js/pimcore/element/helpers/gridColumnConfig.js @@ -857,6 +857,7 @@ pimcore.element.helpers.gridColumnConfig = { this.exportParameters.initial = initial ? 1 : 0; this.exportParameters.language = this.gridLanguage; this.exportParameters.context = Ext.encode(this.context); + this.exportParameters.userTimezone = getUserTimezone(); Ext.Ajax.request({ url: this.exportProcessUrl, diff --git a/public/js/pimcore/functions.js b/public/js/pimcore/functions.js index cf4df45754..1637d65594 100644 --- a/public/js/pimcore/functions.js +++ b/public/js/pimcore/functions.js @@ -1794,6 +1794,10 @@ function htmlspecialchars (string, quoteStyle, charset, doubleEncode) { return string } +function getUserTimezone() { + return Intl.DateTimeFormat().resolvedOptions().timeZone; +} + function dateToServerTimezone(date) { let utcDate = new Date(date.toLocaleString('en-US', { diff --git a/public/js/pimcore/object/versions.js b/public/js/pimcore/object/versions.js index 18470589a1..eb457f97f4 100644 --- a/public/js/pimcore/object/versions.js +++ b/public/js/pimcore/object/versions.js @@ -201,7 +201,11 @@ pimcore.object.versions = Class.create({ var selections = grid.getSelectionModel().getSelection(); - var url = Routing.generate('pimcore_admin_dataobject_dataobject_diffversions', {from: selections[0].data.id, to: selections[1].data.id}); + var url = Routing.generate('pimcore_admin_dataobject_dataobject_diffversions', { + from: selections[0].data.id, + to: selections[1].data.id, + userTimezone: getUserTimezone() + }); Ext.get(this.iframeId).dom.src = url; } }, @@ -211,8 +215,10 @@ pimcore.object.versions = Class.create({ var store = grid.getStore(); var data = store.getAt(rowIndex).data; var versionId = data.id; - - var url = Routing.generate('pimcore_admin_dataobject_dataobject_previewversion', {id: versionId}); + var url = Routing.generate('pimcore_admin_dataobject_dataobject_previewversion', { + id: versionId, + userTimezone: getUserTimezone() + }); Ext.get(this.iframeId).dom.src = url; }, diff --git a/src/Controller/Admin/Asset/AssetController.php b/src/Controller/Admin/Asset/AssetController.php index 84af7a38f5..da06048bc2 100644 --- a/src/Controller/Admin/Asset/AssetController.php +++ b/src/Controller/Admin/Asset/AssetController.php @@ -938,6 +938,8 @@ public function showVersionAction(Request $request): Response } } + Tool\UserTimezone::setUserTimezone($request->query->get('userTimezone')); + $loader = \Pimcore::getContainer()->get('pimcore.implementation_loader.asset.metadata.data'); return $this->render( diff --git a/src/Controller/Admin/DataObject/DataObjectController.php b/src/Controller/Admin/DataObject/DataObjectController.php index 726c3a4296..06b5d8c462 100644 --- a/src/Controller/Admin/DataObject/DataObjectController.php +++ b/src/Controller/Admin/DataObject/DataObjectController.php @@ -1596,6 +1596,9 @@ public function previewVersionAction(Request $request): Response $object = $version?->loadData(); if ($object) { + + Tool\UserTimezone::setUserTimezone($request->query->get('userTimezone')); + if (method_exists($object, 'getLocalizedFields')) { /** @var DataObject\Localizedfield $localizedFields */ $localizedFields = $object->getLocalizedFields(); @@ -1651,6 +1654,8 @@ public function diffVersionsAction(Request $request, int $from, int $to): Respon throw $this->createNotFoundException('Version with id [' . $id2 . "] doesn't exist"); } + Tool\UserTimezone::setUserTimezone($request->query->get('userTimezone')); + if (method_exists($object2, 'getLocalizedFields')) { /** @var DataObject\Localizedfield $localizedFields2 */ $localizedFields2 = $object2->getLocalizedFields(); diff --git a/src/Controller/Admin/DataObject/DataObjectHelperController.php b/src/Controller/Admin/DataObject/DataObjectHelperController.php index 44753e1dbe..6a12b1ed3c 100644 --- a/src/Controller/Admin/DataObject/DataObjectHelperController.php +++ b/src/Controller/Admin/DataObject/DataObjectHelperController.php @@ -1220,6 +1220,7 @@ public function doExportAction( $settings = json_decode($request->get('settings'), true); $delimiter = $settings['delimiter'] ?? ';'; $header = $settings['header'] ?? 'title'; + Tool\UserTimezone::setUserTimezone($request->request->get('userTimezone')); $allParams = array_merge($request->request->all(), $request->query->all());