Browse Source

Merge pull request 'Fix date range' (#66) from dev-wahyu into staging

Reviewed-on: ordo/adw-frontend#66
pull/2/head
ibnu 1 year ago
parent
commit
b2c789d3e0
  1. 3
      src/views/Dashboard/DashboardProject.js

3
src/views/Dashboard/DashboardProject.js

@ -290,6 +290,9 @@ const DashboardProject = () => {
let now = new Date().toISOString().slice(0, 10); let now = new Date().toISOString().slice(0, 10);
let dates = result.data.data[0].data?.date; let dates = result.data.data[0].data?.date;
let n = dates.findIndex(element => new Date(now) < new Date(element[0])) - 1; let n = dates.findIndex(element => new Date(now) < new Date(element[0])) - 1;
if (n < 0) {
n = dates.length - 1;
}
if (result.data.data.length > 0 && result.data.data[0].data?.percentagePlan && result.data.data[0].data?.percentagePlan.length > 0) { if (result.data.data.length > 0 && result.data.data[0].data?.percentagePlan && result.data.data[0].data?.percentagePlan.length > 0) {
if(SCURVE && SCURVE == "1"){ if(SCURVE && SCURVE == "1"){
planningProgress = result.data.data[0].data?.percentagePlan[result.data.data[0].data?.percentagePlan.length - 1]; planningProgress = result.data.data[0].data?.percentagePlan[result.data.data[0].data?.percentagePlan.length - 1];

Loading…
Cancel
Save