Browse Source

Merge branch 'master' of https://git.oslog.id/ordo/adw-frontend

pull/2/head
ardhi 2 years ago
parent
commit
1695421c33
  1. 12
      src/const/CustomFunc.js
  2. 4
      src/views/SimproV2/Presence/index.js

12
src/const/CustomFunc.js

@ -285,7 +285,17 @@ export const formatThousand = (x) => {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ".");
}
export const formatLargeNumber = (num) => {
const formattedNum = formatThousand(num);
if (num >= 1000000000000) {
return `${(num / 1000000000000).toFixed(1)}T`;
} else if (num >= 1000000000) {
return `${(num / 1000000000).toFixed(1)}M`;
} else if (num >= 1000000) {
return `${(num / 1000000).toFixed(1)}Jt`;
}
return formattedNum;
};
/*
Using it:
sortBy(data, {

4
src/views/SimproV2/Presence/index.js

@ -247,8 +247,8 @@ const Index = ({ params }) => {
{ title: 'Durasi Kerja', render: (text, record) => (<div style={{ whiteSpace: "nowrap" }}>{renderDurasiKerja(record.clock_in, record.clock_out)}</div>) },
{ title: 'Lokasi Masuk', dataIndex: 'clock_in_loc', key: 'clock_in_loc', render: (text, record) => <>{text && text !== '' ? text : '-'}</> },
{ title: 'Lokasi Pulang', dataIndex: 'clock_out_loc', key: 'clock_out_loc', render: (text, record) => <>{text && text !== '' ? text : '-'}</> },
{ title: 'Area Kerja In', dataIndex: 'clock_out_loc', key: 'clock_out_loc', render: (text, record) => (<div style={{ whiteSpace: "nowrap", textAlign: "center" }}>{record.clock_in_boundary ? <i className="fa fa-check-circle" style={{ color: 'green' }}></i> : <i className="fa fa-times-circle" style={{ color: 'red' }}></i>}</div>) },
{ title: 'Area Kerja Out', dataIndex: 'clock_out_loc', key: 'clock_out_loc', render: (text, record) => (<div style={{ whiteSpace: "nowrap", textAlign: "center" }}>{record.clock_out_boundary ? <i className="fa fa-check-circle" style={{ color: 'green' }}></i> : <i className="fa fa-times-circle" style={{ color: 'red' }}></i>}</div>) },
{ title: 'Area Kerja In', dataIndex: 'clock_out_loc', key: 'clock_out_loc', render: (text, record) => (<div style={{ whiteSpace: "nowrap", textAlign: "center" }}>{record.clock_in_boundary ? <i className="fa fa-check-circle fa-lg" style={{ color: 'green' }}></i> : <i className="fa fa-times-circle fa-lg" style={{ color: 'red' }}></i>}</div>) },
{ title: 'Area Kerja Out', dataIndex: 'clock_out_loc', key: 'clock_out_loc', render: (text, record) => (<div style={{ whiteSpace: "nowrap", textAlign: "center" }}>{record.clock_out_boundary == null ? <i class="fa fa-window-minimize fa-lg" style={{ color: 'orange' }}></i> : record.clock_out_boundary ? <i className="fa fa-check-circle fa-lg" style={{ color: 'green' }}></i> : <i className="fa fa-times-circle fa-lg" style={{ color: 'red' }}></i>}</div>) },
];
return (
<Table

Loading…
Cancel
Save