summaryrefslogtreecommitdiff
path: root/addons/hr_holidays/static/src/components/thread_view/thread_view.js
diff options
context:
space:
mode:
authorXavier Dubuc <xdu@odoo.com>2020-11-10 08:59:25 +0000
committerSébastien Theys <seb@odoo.com>2020-11-30 15:21:27 +0000
commitd9aa362914945e6cb095b04fa94cfb3469abd907 (patch)
treed234604da02879d539155206949e112d437957c2 /addons/hr_holidays/static/src/components/thread_view/thread_view.js
parent24d52d4a8d0f475bb62b6653c08ce409e27e1d58 (diff)
[FIX] hr_holidays: bring back the out of office panel in threads
task-2277511 closes odoo/odoo#61586 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons/hr_holidays/static/src/components/thread_view/thread_view.js')
-rw-r--r--addons/hr_holidays/static/src/components/thread_view/thread_view.js29
1 files changed, 0 insertions, 29 deletions
diff --git a/addons/hr_holidays/static/src/components/thread_view/thread_view.js b/addons/hr_holidays/static/src/components/thread_view/thread_view.js
index 89923ff0384..c07ab2189a9 100644
--- a/addons/hr_holidays/static/src/components/thread_view/thread_view.js
+++ b/addons/hr_holidays/static/src/components/thread_view/thread_view.js
@@ -5,38 +5,9 @@ const components = {
ThreadView: require('mail/static/src/components/thread_view/thread_view.js'),
};
-const { str_to_datetime } = require('web.time');
const { patch } = require('web.utils');
patch(components.ThreadView, 'hr_holidays/static/src/components/thread_view/thread_view.js', {
-
- //--------------------------------------------------------------------------
- // Public
- //--------------------------------------------------------------------------
-
- /**
- * Returns the "out of office" text for the correspondent of the thread if
- * applicable.
- *
- * @returns {string}
- */
- getOutOfOfficeText() {
- if (!this.threadView.thread.correspondent) {
- return "";
- }
- if (!this.threadView.thread.correspondent.out_of_office_date_end) {
- return "";
- }
- const currentDate = new Date();
- const date = str_to_datetime(this.threadView.thread.correspondent.out_of_office_date_end);
- const options = { day: 'numeric', month: 'short' };
- if (currentDate.getFullYear() !== date.getFullYear()) {
- options.year = 'numeric';
- }
- const formattedDate = date.toLocaleDateString(window.navigator.language, options);
- return _.str.sprintf(this.env._t("Out of office until %s."), formattedDate);
- },
-
//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------