[FIX] web_editor: wrong time in history of changes
Before this commit: When a user edits an article and selects the restore button to revert to a previous version, the displayed time is incorrect because it shows universal time instead of the user's timezone. After this commit: When a user edits an article and utilizes the restore button to revert to a previous version, the timestamp will now reflect the time in the user's current timezone. task-3641579 closes odoo/odoo#149177 Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
This commit is contained in:
@@ -32,6 +32,7 @@ class HistoryDialog extends Component {
|
||||
this.size = 'xl';
|
||||
this.title = _t('History');
|
||||
this.orm = useService('orm');
|
||||
this.userService = useService('user');
|
||||
|
||||
onMounted(() => this.init());
|
||||
}
|
||||
@@ -90,7 +91,7 @@ class HistoryDialog extends Component {
|
||||
* Getters
|
||||
**/
|
||||
getRevisionDate(revision) {
|
||||
return formatDateTime(DateTime.fromISO(revision['create_date']));
|
||||
return formatDateTime(DateTime.fromISO(revision['create_date'], { zone: 'utc' }).setZone(this.userService.tz));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user