diff --git a/addons/hr_holidays/static/src/js/time_off_calendar/time_off_calendar_controller.js b/addons/hr_holidays/static/src/js/time_off_calendar/time_off_calendar_controller.js index 7e3da3e3c9e..a35b5120139 100644 --- a/addons/hr_holidays/static/src/js/time_off_calendar/time_off_calendar_controller.js +++ b/addons/hr_holidays/static/src/js/time_off_calendar/time_off_calendar_controller.js @@ -183,9 +183,23 @@ export const TimeOffCalendarController = CalendarController.extend({ }, _getTimeOffContext() { + let date_from = moment().set({ + 'hour': 0, + 'minute': 0, + 'second': 0 + }); + date_from.subtract(this.getSession().getTZOffset(date_from), 'minutes'); + date_from = date_from.locale('en').format('YYYY-MM-DD HH:mm:ss'); + let date_to = moment().set({ + 'hour': 23, + 'minute': 59, + 'second': 59 + }); + date_to.subtract(this.getSession().getTZOffset(date_to), 'minutes'); + date_to = date_to.locale('en').format('YYYY-MM-DD HH:mm:ss'); return { - 'default_date_from': moment().locale('en').format('YYYY-MM-DD'), - 'default_date_to': moment().add(1, 'days').locale('en').format('YYYY-MM-DD'), + 'default_date_from': date_from, + 'default_date_to': date_to, 'lang': this.context.lang, 'form_view_ref': 'hr_holidays.hr_leave_view_form_dashboard_new_time_off' };