float to time in dashboard
This commit is contained in:
parent
95e7fedfbd
commit
e28c02a469
|
|
@ -309,7 +309,7 @@ attendanceLines.forEach(line => {
|
||||||
const dateStr = createDate.toLocaleDateString('en-IN', { timeZone: 'Asia/Kolkata' });
|
const dateStr = createDate.toLocaleDateString('en-IN', { timeZone: 'Asia/Kolkata' });
|
||||||
|
|
||||||
const workedHours = parseFloat(line.worked_hours);
|
const workedHours = parseFloat(line.worked_hours);
|
||||||
|
const working_hours = ''
|
||||||
const checkIn = new Date(line.check_in + 'Z');
|
const checkIn = new Date(line.check_in + 'Z');
|
||||||
const checkOut = new Date(line.check_out + 'Z');
|
const checkOut = new Date(line.check_out + 'Z');
|
||||||
|
|
||||||
|
|
@ -320,6 +320,7 @@ attendanceLines.forEach(line => {
|
||||||
groupedLines[dateStr] = {
|
groupedLines[dateStr] = {
|
||||||
create_date: dateStr,
|
create_date: dateStr,
|
||||||
worked_hours: workedHours,
|
worked_hours: workedHours,
|
||||||
|
working_hours: `${Math.floor(workedHours)}h ${Math.round((workedHours - Math.floor(workedHours)) * 60)}m`,
|
||||||
check_in: checkInStr,
|
check_in: checkInStr,
|
||||||
check_out: checkOutStr,
|
check_out: checkOutStr,
|
||||||
earliestCheckIn: checkIn,
|
earliestCheckIn: checkIn,
|
||||||
|
|
@ -346,6 +347,7 @@ attendanceLines.forEach(line => {
|
||||||
const groupedAttendance = Object.values(groupedLines).map(line => ({
|
const groupedAttendance = Object.values(groupedLines).map(line => ({
|
||||||
create_date: line.create_date,
|
create_date: line.create_date,
|
||||||
worked_hours: line.worked_hours.toFixed(2),
|
worked_hours: line.worked_hours.toFixed(2),
|
||||||
|
working_hours :line.working_hours,
|
||||||
check_in: line.check_in,
|
check_in: line.check_in,
|
||||||
check_out: line.check_out
|
check_out: line.check_out
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td t-esc="line['check_out']">
|
<td t-esc="line['check_out']">
|
||||||
</td>
|
</td>
|
||||||
<td t-esc="line['worked_hours']">
|
<td t-esc="line['working_hours']">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue