From 1fb8f3b5528965c5199750bcd76d1d85cfb7569a Mon Sep 17 00:00:00 2001 From: raman Date: Thu, 30 Jan 2025 09:59:01 +0530 Subject: [PATCH] {FIX} :time Zone fix --- .../hr_emp_dashboard/static/src/js/profile_component.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons_extensions/hr_emp_dashboard/static/src/js/profile_component.js b/addons_extensions/hr_emp_dashboard/static/src/js/profile_component.js index 717cb8845..12dd660e0 100644 --- a/addons_extensions/hr_emp_dashboard/static/src/js/profile_component.js +++ b/addons_extensions/hr_emp_dashboard/static/src/js/profile_component.js @@ -146,10 +146,10 @@ export class NetflixProfileContainer extends Component { attendanceLines.forEach(line => { let createDate = new Date(line.create_date); line.create_date = createDate.toISOString().split('T')[0]; // Format as 'YYYY-MM-DD' - let checkIn = new Date(line.check_in); - line.check_in = checkIn.toTimeString().slice(0, 5); // Format as 'HH:MM' - let checkOut = new Date(line.check_out); - line.check_out = checkOut.toTimeString().slice(0, 5); // Format as 'HH:MM' + let checkIn = new Date(line.check_in + 'Z'); + line.check_in = checkIn.toLocaleTimeString([], {hour: '2-digit', minute: '2-digit', timeZone:'Asia/Kolkata'}); // Format as 'HH:MM' + let checkOut = new Date(line.check_out + 'Z'); + line.check_out = checkOut.toLocaleTimeString([], {hour: '2-digit', minute: '2-digit', timeZone:'Asia/Kolkata'}); // Format as 'HH:MM' line.worked_hours = line.worked_hours.toFixed(2); }); this.state.attendance_lines = attendanceLines,