dashboard fix

This commit is contained in:
raman 2025-02-05 18:46:53 +05:30
parent 4ab920555c
commit e8358b050b
1 changed files with 15 additions and 1 deletions

View File

@ -44,6 +44,20 @@ export class NetflixProfileContainer extends Component {
this.fetchEmployeeData(); this.fetchEmployeeData();
}); });
} }
hr_timesheets() {
this.action.doAction({
name: "Timesheets",
type: 'ir.actions.act_window',
res_model: 'account.analytic.line',
view_mode: 'list,form',
views: [[false, 'list'], [false, 'form']],
context: {
'search_default_month': true,
},
domain: [['employee_id.user_id','=', this.props.action.context.user_id]],
target: 'current'
})
}
attendance_sign_in_out() { attendance_sign_in_out() {
if (this.state.login_employee.attendance_state == 'checked_out') { if (this.state.login_employee.attendance_state == 'checked_out') {
this.state.login_employee.attendance_state = 'checked_in' this.state.login_employee.attendance_state = 'checked_in'
@ -145,7 +159,7 @@ export class NetflixProfileContainer extends Component {
const employee = employeeData[0]; const employee = employeeData[0];
attendanceLines.forEach(line => { attendanceLines.forEach(line => {
let createDate = new Date(line.create_date); let createDate = new Date(line.create_date);
line.create_date = createDate.toISOString().split('T')[0]; // Format as 'YYYY-MM-DD' line.create_date = createDate.toLocaleDateString('en-IN', { timeZone: 'Asia/Kolkata' }); // Format as 'YYYY-MM-DD'
let checkIn = new Date(line.check_in + 'Z'); 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' 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'); let checkOut = new Date(line.check_out + 'Z');