From 6325489664d515e4b2825535b8267d332ec1b38d Mon Sep 17 00:00:00 2001 From: JhonSGIzquierdo Date: Fri, 15 Mar 2024 08:54:30 -0500 Subject: [PATCH 01/17] :wrench: chore(Timeline): Create structure of new timeline --- .../WEB-INF/crp/views/home/dashboard.ftl | 15 ++++++++ .../main/webapp/crp/css/home/dashboard.css | 36 +++++++++++++++++++ .../src/main/webapp/crp/js/home/dashboard.js | 30 ++++++++++++++++ 3 files changed, 81 insertions(+) diff --git a/marlo-web/src/main/webapp/WEB-INF/crp/views/home/dashboard.ftl b/marlo-web/src/main/webapp/WEB-INF/crp/views/home/dashboard.ftl index 3bd4264102..ccc0477da2 100644 --- a/marlo-web/src/main/webapp/WEB-INF/crp/views/home/dashboard.ftl +++ b/marlo-web/src/main/webapp/WEB-INF/crp/views/home/dashboard.ftl @@ -123,6 +123,21 @@ [/#if] +[#if action.hasSpecificities('homepage_timeline_active') ] +
+
Schedule
+ +
+ +[/#if] +
diff --git a/marlo-web/src/main/webapp/crp/css/home/dashboard.css b/marlo-web/src/main/webapp/crp/css/home/dashboard.css index 43df02e1ce..39d6c4cf0d 100644 --- a/marlo-web/src/main/webapp/crp/css/home/dashboard.css +++ b/marlo-web/src/main/webapp/crp/css/home/dashboard.css @@ -211,6 +211,8 @@ div#impactGraphic-fullscreen { height: 100%; } + /*************** Timeline ********************/ + span.leftControl { left: 5px; } @@ -411,6 +413,40 @@ span.timelineControl:hover { height: 50px; align-self: center; } + + #timelineContainer { + position: relative; + padding-top: 1rem; + width: 90vw; + overflow-x: scroll; + } + + #timeline_times { + display: flex; + width: max-content; + margin-top: 10px; + margin-bottom: 10px; + background-color: #D9D9D9; + padding: 5px 0; + } + + #timeline_today { + position: absolute; + top: 0; + left: 0; + width: 2px; + height: 100%; + background-color: red; + border-radius: 5px; + } + + .ansbox { + width: 80px; + background-color: grey; + height: 2px; + margin-right: 2px; + position: relative; + } /*************** sectionMap ********************/ diff --git a/marlo-web/src/main/webapp/crp/js/home/dashboard.js b/marlo-web/src/main/webapp/crp/js/home/dashboard.js index bbe7b4146a..31476da3b5 100644 --- a/marlo-web/src/main/webapp/crp/js/home/dashboard.js +++ b/marlo-web/src/main/webapp/crp/js/home/dashboard.js @@ -18,6 +18,7 @@ function initDashboard() { getTimeline(); createTimeline(); + createTimeline2(); $('.buttonRightTimeline').on("click", moveScrollRight); @@ -249,6 +250,35 @@ function createTimeline() { } +const getFirstAndLastDates = (dates) => { + const sortDatesByStart = dates.map(date => Date.parse(date.startDate)).sort((a, b) => a - b); + //console.log(sortDatesByStart); + const sortDatesByEnd = dates.map(date => Date.parse(date.endDate)).sort((a, b) => a - b); + //console.log(sortDatesByEnd); + return { + firstDate: sortDatesByStart[0], + lastDate: sortDatesByEnd[sortDatesByEnd.length - 1] + }; +} + +function createTimeline2() { + const listItemTimeline=document.getElementById("listItemTimeline2"); + listItemTimeline.innerHTML = ` +
+

Schedule

+
+
+
+
+
+
+ +
+ +
+ ` +} + function updateTable(){ // console.log(this.attr("id")) let nameId =$(this).attr("id"); From 5b95f2a76d03c4b7df1ff8038b5ebc30094664f4 Mon Sep 17 00:00:00 2001 From: JhonSGIzquierdo Date: Fri, 15 Mar 2024 09:28:47 -0500 Subject: [PATCH 02/17] :wrench: chore(Timeline): Set range of Dates --- .../src/main/webapp/crp/js/home/dashboard.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/marlo-web/src/main/webapp/crp/js/home/dashboard.js b/marlo-web/src/main/webapp/crp/js/home/dashboard.js index 31476da3b5..7cbe636588 100644 --- a/marlo-web/src/main/webapp/crp/js/home/dashboard.js +++ b/marlo-web/src/main/webapp/crp/js/home/dashboard.js @@ -252,20 +252,33 @@ function createTimeline() { const getFirstAndLastDates = (dates) => { const sortDatesByStart = dates.map(date => Date.parse(date.startDate)).sort((a, b) => a - b); - //console.log(sortDatesByStart); const sortDatesByEnd = dates.map(date => Date.parse(date.endDate)).sort((a, b) => a - b); - //console.log(sortDatesByEnd); return { firstDate: sortDatesByStart[0], lastDate: sortDatesByEnd[sortDatesByEnd.length - 1] }; } +function convertDateToText(date) { + return new Date(date).toLocaleString('default', { month: 'short', day: 'numeric', year: "numeric" }); +} + function createTimeline2() { + const getFirstDateText = convertDateToText(getFirstAndLastDates(timelineElements).firstDate); + const getLastDateText = convertDateToText(getFirstAndLastDates(timelineElements).lastDate); + const listItemTimeline=document.getElementById("listItemTimeline2"); listItemTimeline.innerHTML = `
-

Schedule

+
+
+ Schedule +
+
${getFirstDateText} - ${getLastDateText}
+
+ + +
From 6358fc61c341066966a9beffc038801d963810e2 Mon Sep 17 00:00:00 2001 From: JhonSGIzquierdo Date: Fri, 15 Mar 2024 10:32:14 -0500 Subject: [PATCH 03/17] :wrench: chore(Timeline): style timeline description --- .../webapp/WEB-INF/crp/views/home/dashboard.ftl | 1 - .../src/main/webapp/crp/css/home/dashboard.css | 17 +++++++++++++++++ .../src/main/webapp/crp/js/home/dashboard.js | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/marlo-web/src/main/webapp/WEB-INF/crp/views/home/dashboard.ftl b/marlo-web/src/main/webapp/WEB-INF/crp/views/home/dashboard.ftl index ccc0477da2..92354bac6c 100644 --- a/marlo-web/src/main/webapp/WEB-INF/crp/views/home/dashboard.ftl +++ b/marlo-web/src/main/webapp/WEB-INF/crp/views/home/dashboard.ftl @@ -129,7 +129,6 @@
[/#if] diff --git a/marlo-web/src/main/webapp/crp/css/home/dashboard.css b/marlo-web/src/main/webapp/crp/css/home/dashboard.css index 7333905824..f2aef70949 100644 --- a/marlo-web/src/main/webapp/crp/css/home/dashboard.css +++ b/marlo-web/src/main/webapp/crp/css/home/dashboard.css @@ -425,6 +425,10 @@ span.timelineControl:hover { margin: 0 auto; } + #timelineContainer::-webkit-scrollbar { + -webkit-appearance: none; + } + #timelineDescription{ display: flex; justify-content: space-between; diff --git a/marlo-web/src/main/webapp/crp/js/home/dashboard.js b/marlo-web/src/main/webapp/crp/js/home/dashboard.js index 4fa6df4971..607a8f8b80 100644 --- a/marlo-web/src/main/webapp/crp/js/home/dashboard.js +++ b/marlo-web/src/main/webapp/crp/js/home/dashboard.js @@ -150,13 +150,19 @@ function locateContentDialog(id){ } function moveScrollRight() { - const element = document.querySelector(".scroll-x-containerTimeline"); - element.scrollLeft += 200; + const element = document.getElementById("timelineContainer"); + const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0); + const containerSize = vw * 0.8; + + element.scrollLeft += containerSize; } function moveScrollLeft() { - const element = document.querySelector(".scroll-x-containerTimeline"); - element.scrollLeft -= 200; + const element = document.getElementById("timelineContainer"); + const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0); + const containerSize = vw * 0.8; + + element.scrollLeft -= containerSize; } function createTimeline() { @@ -260,13 +266,6 @@ const getAbsoluteDays = (startDate, endDate) => { return Math.round(Math.abs((new Date(startDate) - new Date(endDate)) / oneDay)); }; -const getRemainingDays = (endDate) => { - const oneDay = 24 * 60 * 60 * 1000; - const today = new Date(); - - return new Date(endDate) - today > 0 ? Math.round(Math.abs((new Date(today) - new Date(endDate)) / oneDay)) : 0; -} - const getFirstAndLastDates = (dates) => { const sortDatesByStart = dates.map(date => Date.parse(date.startDate)).sort((a, b) => a - b); const sortDatesByEnd = dates.map(date => Date.parse(date.endDate)).sort((a, b) => a - b); @@ -357,29 +356,37 @@ function setWidth(amount) { return `calc(${amount !==undefined? (amount === 0? 3: amount)+"*(80vw / 7))": "calc(80vw / 7)"}`; } -function setDistances(startDate,isToday) { +function setDistances(startDate,isToday, isJS) { const today = new Date(); const { firstDate } = getFirstAndLastDates(timelineElements); - if(isToday){ - return `calc(${getAbsoluteDays(firstDate, today)} * (80vw / 7))`; + const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0); + let containerSize = vw * 0.8; + + if(isJS){ + + if(isToday){ + return (getAbsoluteDays(firstDate,today) * (containerSize/7)) + } + + return (getAbsoluteDays(firstDate,startDate) * (containerSize/7)) + + } else { + + if(isToday){ + return `calc(${getAbsoluteDays(firstDate, today)} * (80vw / 7))`; + } + + return `calc(${getAbsoluteDays(firstDate, startDate)} * (80vw / 7))`; } - - return `calc(${getAbsoluteDays(firstDate, startDate)} * (80vw / 7))`; - } function setTimelinePosition(){ let weekStart = new Date(); weekStart.setDate(weekStart.getDate() - weekStart.getDay()) - const { firstDate } = getFirstAndLastDates(timelineElements); - - const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0); - let containerSize = vw * 0.8; - const timelineContainer = document.getElementById("timelineContainer"); - timelineContainer.scrollLeft += (getAbsoluteDays(firstDate,weekStart) * (containerSize/7)) + timelineContainer.scrollLeft += setDistances(weekStart, undefined,true); console.log(timelineContainer.scrollLeft); } From e5d856687f89b596a1120866876709b332f7627a Mon Sep 17 00:00:00 2001 From: JhonSGIzquierdo Date: Thu, 21 Mar 2024 15:46:57 -0500 Subject: [PATCH 15/17] :wrench: chore(Timeline): date with african update --- marlo-web/src/main/webapp/crp/js/home/dashboard.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/marlo-web/src/main/webapp/crp/js/home/dashboard.js b/marlo-web/src/main/webapp/crp/js/home/dashboard.js index 607a8f8b80..ec6de54c8c 100644 --- a/marlo-web/src/main/webapp/crp/js/home/dashboard.js +++ b/marlo-web/src/main/webapp/crp/js/home/dashboard.js @@ -257,8 +257,12 @@ function createTimeline() { } +const convertDateToAfricanDate = (date) => { + const africanOptions = { timeZone: 'Africa/Nairobi', month: 'short', day: 'numeric', year: "numeric" }; + return new Date(date.toLocaleString('en-US', africanOptions)); +} const convertDateToText = (date, withYear) => { - return new Date(date).toLocaleString('default', withYear? { month: 'short', day: 'numeric', year: "numeric" } : { month: 'short', day: 'numeric' }); + return new Date(date).toLocaleString('default', withYear? { timeZone: 'Africa/Nairobi', month: 'short', day: 'numeric', year: "numeric" } : { timeZone: 'Africa/Nairobi', month: 'short', day: 'numeric' }); } const getAbsoluteDays = (startDate, endDate) => { @@ -283,7 +287,7 @@ function getDateBasedOnASumOfDays(startDate, days) { function createDivTimes(totalDays, divClass, divIdPrefix){ let arrayDays = []; - for(let i=0; i < totalDays; i++){ + for(let i=0; i < totalDays+1; i++){ let newDiv = document.createElement('div'); newDiv.id = `time_${i}` newDiv.className = divClass; @@ -353,7 +357,7 @@ const setStatusColor = (status) => { } function setWidth(amount) { - return `calc(${amount !==undefined? (amount === 0? 3: amount)+"*(80vw / 7))": "calc(80vw / 7)"}`; + return `calc(${amount !==undefined? (amount === 0? 3: amount+1)+"*(80vw / 7))": "calc(80vw / 7)"}`; } function setDistances(startDate,isToday, isJS) { @@ -407,7 +411,6 @@ function createTimeline2() {

${convertDateToText(getFirstDate,true)} - ${convertDateToText(getLastDate,true)}

-
${createDivTimes(getTotalDays,"timebox",getFirstDate).reduce((acc, curr) => acc + curr.outerHTML, '')}
@@ -416,7 +419,7 @@ function createTimeline2() { ${createDivActivities(elem,id).outerHTML} ` ).join('')}
- +
` From 86ceba24a8ff024d1393926127bb29d12eb4a5c8 Mon Sep 17 00:00:00 2001 From: JhonSGIzquierdo Date: Thu, 21 Mar 2024 16:41:29 -0500 Subject: [PATCH 16/17] :wrench: chore(Timeline): visual updates --- .../WEB-INF/crp/views/home/dashboard.ftl | 21 --- .../main/webapp/crp/css/home/dashboard.css | 11 +- .../src/main/webapp/crp/js/home/dashboard.js | 123 +++--------------- .../main/webapp/global/images/end_date.png | Bin 0 -> 185 bytes .../main/webapp/global/images/start_date.png | Bin 0 -> 193 bytes 5 files changed, 29 insertions(+), 126 deletions(-) create mode 100644 marlo-web/src/main/webapp/global/images/end_date.png create mode 100644 marlo-web/src/main/webapp/global/images/start_date.png diff --git a/marlo-web/src/main/webapp/WEB-INF/crp/views/home/dashboard.ftl b/marlo-web/src/main/webapp/WEB-INF/crp/views/home/dashboard.ftl index 97309d5b4d..6a04e9aba7 100644 --- a/marlo-web/src/main/webapp/WEB-INF/crp/views/home/dashboard.ftl +++ b/marlo-web/src/main/webapp/WEB-INF/crp/views/home/dashboard.ftl @@ -102,27 +102,6 @@
-[#if action.hasSpecificities('homepage_timeline_active') ] -
-
Schedule
- -
- -[/#if] - [#if action.hasSpecificities('homepage_timeline_active') ]
Schedule
diff --git a/marlo-web/src/main/webapp/crp/css/home/dashboard.css b/marlo-web/src/main/webapp/crp/css/home/dashboard.css index f2aef70949..931f4960ab 100644 --- a/marlo-web/src/main/webapp/crp/css/home/dashboard.css +++ b/marlo-web/src/main/webapp/crp/css/home/dashboard.css @@ -501,7 +501,7 @@ span.timelineControl:hover { .activityCard_content{ display: inline-flex; flex-direction: column; - gap: 0.5rem; + gap: 0.25rem; left: 0; overflow: hidden; padding: 4px 6px; @@ -523,8 +523,15 @@ span.timelineControl:hover { .activityCard_details{ display: flex; justify-content: space-between; + align-items: center; max-width: max-content; - gap: 1rem; + gap: 2rem; + } + + .activityCard_details div{ + display: flex; + align-items: center; + gap: 0.5rem; } .activityCard_details p{ diff --git a/marlo-web/src/main/webapp/crp/js/home/dashboard.js b/marlo-web/src/main/webapp/crp/js/home/dashboard.js index ec6de54c8c..651f942047 100644 --- a/marlo-web/src/main/webapp/crp/js/home/dashboard.js +++ b/marlo-web/src/main/webapp/crp/js/home/dashboard.js @@ -17,8 +17,9 @@ function initDashboard() { $('.loadingBlock').hide().next().fadeIn(500); getTimeline(); - createTimeline(); createTimeline2(); + $(".timelineRefresh").hide(); + $(".timeline").show(); setTimelinePosition(); $('.buttonRightTimeline').on("click", moveScrollRight); @@ -165,98 +166,6 @@ function moveScrollLeft() { element.scrollLeft -= containerSize; } -function createTimeline() { - var counter = 0; - var counterActvi = 0; - var previusDate; - var linePorcent; - var lastPosition = timelineElements.length; - - // iterate timeline elements - timelineElements.forEach(function(data,index){ - var listItemTimeline=document.getElementById("listItemTimeline"); - var newDiv= document.createElement("div") - newDiv.className='infTimelineTimeline'; - listItemTimeline.appendChild(newDiv); - var newDivTitle= document.createElement("span") - newDivTitle.className='titleTimeline'; - newDiv.appendChild(newDivTitle) - var newDivPoint= document.createElement("div") - newDivPoint.className='timeline-pointTimeline'; - newDiv.appendChild(newDivPoint) - var newPorcentTimeLine= document.createElement("div") - newDiv.appendChild(newPorcentTimeLine) - var newDivTimeLine= document.createElement("div") - newDivTimeLine.className='timeline-line'; - newDiv.appendChild(newDivTimeLine) - var newPTimeLine= document.createElement("p") - newPTimeLine.className='dateTimeline'; - newDiv.appendChild(newPTimeLine) - var options = {timeZone: 'Africa/Nairobi', year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric'}; - var africaOpciones = { timeZone: 'Africa/Nairobi', day: 'numeric' }; - var africanDate = new Date(new Date().toLocaleString('en-US', options)); - - var description = document.createTextNode(data.description); - var dateMonthStart = new Date(data.startDate).toLocaleString("en-US", { month: "short" }); - var dateDayStart = new Date(data.startDate).getDate()+1; - var dateMonthYear =new Date(data.endDate).getFullYear(); - var dateMonthEnd = new Date(new Date(data.endDate).toLocaleString('en-US', options)).toLocaleString("en-US", { month: "short" }); - var dateDayEnd = new Date(data.endDate).toLocaleString('en-US', africaOpciones); - var date =document.createTextNode(dateMonthEnd+' '+ dateDayEnd+' - '+dateMonthYear) - newDivTitle.appendChild(description); - newPTimeLine.appendChild(date); - var endDate = new Date(new Date(data.endDate).toLocaleString('en-US', options)); - endDate.setDate(endDate.getDate() + 1) - - if(description.length > 120)newDivTitle.style["width"] = '120px'; - - //hide alert the days left to finalize activity - if(((lastPosition - 1) == index) && endDate < africanDate )$('.timelineAlert').hide(); - - var closingTime = new Date(africanDate.setHours(africanDate.getHours() + 1)); - - if(endDate < closingTime){ - - var newImgTimeLine= document.createElement("img"); - newImgTimeLine.className='imgTimeline'; - newImgTimeLine.setAttribute("src",baseURL +"/global/images/icon-check-tiny-white.png") - newDivPoint.appendChild(newImgTimeLine); - newDivTitle.classList.add('timelineColorSuccess'); - newDivPoint.classList.add('timelineBackSuccess'); - newDivTimeLine.classList.add('timelineBackSuccess'); - previusDate=data.endDate; - counterActvi =counterActvi+1 - - } - // Define the color and percentage of the bar - if(counter == 0 && (endDate > africanDate)){ - - let dateDiff = endDate.getTime() - new Date(previusDate).getTime(); - let daysFinalizeActivity = ((endDate.getTime() - africanDate.getTime())/(1000*60*60*24)); - newPorcentTimeLine.className='porcentTimeLine'; - newDivTitle.classList.add('timelineColorAlert'); - newDivPoint.classList.add('timelineBackAlert'); - - linePorcent = -(daysFinalizeActivity*100)/(dateDiff/(1000*60*60*24))+100; - newDivTimeLine.style["margin-top"] = "0"; - newPorcentTimeLine.style["width"] = Math.round(linePorcent)+'%'; - if(linePorcent < 0) newPorcentTimeLine.style["width"] = Math.round(0)+'%'; - newPorcentTimeLine.appendChild(newDivTimeLine); - let textAlert =''; - textAlert = Math.round(daysFinalizeActivity+1)+' day left to finalize the current activity'; - if(Math.round(daysFinalizeActivity+1)>1) textAlert = Math.round(daysFinalizeActivity+1)+' days left to finalize the current activity'; - counter = 1; - $('.timelineAlertText').text(textAlert); - } - }) - $(".timelineRefresh").hide(); - $(".timeline").show(); - // Locate pending activity - const element = document.querySelector(".scroll-x-containerTimeline"); - element.scrollLeft += 243*(counterActvi-2); - -} - const convertDateToAfricanDate = (date) => { const africanOptions = { timeZone: 'Africa/Nairobi', month: 'short', day: 'numeric', year: "numeric" }; return new Date(date.toLocaleString('en-US', africanOptions)); @@ -294,7 +203,7 @@ function createDivTimes(totalDays, divClass, divIdPrefix){ newDiv.style.width = setWidth(); newDiv.innerHTML = `

- ${convertDateToText(getDateBasedOnASumOfDays(divIdPrefix,i))} + ${convertDateToText(getDateBasedOnASumOfDays(divIdPrefix,i))}

`; arrayDays.push(newDiv); @@ -318,9 +227,15 @@ function createDivActivities(activity, id){

${activity.description}

-

Start date: ${activity.startDate}

-

Status: ${status}

-

End date: ${activity.endDate}

+
+ start_icon +

Start date: ${activity.startDate}

+
+

Status: ${status}

+
+ end_icon +

End date: ${activity.endDate}

+
@@ -362,6 +277,11 @@ function setWidth(amount) { function setDistances(startDate,isToday, isJS) { const today = new Date(); + today.setDate(today.getDate()-1); + let startofDay = new Date(today.getTime()); + startofDay.setHours(0,0,0,0); + const porcentOfDay = ((today.getTime() - startofDay.getTime()) / (1000*60*60*24)) + console.log(porcentOfDay); const { firstDate } = getFirstAndLastDates(timelineElements); const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0); @@ -370,7 +290,7 @@ function setDistances(startDate,isToday, isJS) { if(isJS){ if(isToday){ - return (getAbsoluteDays(firstDate,today) * (containerSize/7)) + return (getAbsoluteDays(firstDate,today) * ((containerSize/7) + ((containerSize/7)*porcentOfDay)) ) } return (getAbsoluteDays(firstDate,startDate) * (containerSize/7)) @@ -378,7 +298,7 @@ function setDistances(startDate,isToday, isJS) { } else { if(isToday){ - return `calc(${getAbsoluteDays(firstDate, today)} * (80vw / 7))`; + return `calc(${getAbsoluteDays(firstDate, today)} * (80vw / 7) + ((80vw / 7)* ${porcentOfDay}) )`; } return `calc(${getAbsoluteDays(firstDate, startDate)} * (80vw / 7))`; @@ -391,7 +311,7 @@ function setTimelinePosition(){ const timelineContainer = document.getElementById("timelineContainer"); timelineContainer.scrollLeft += setDistances(weekStart, undefined,true); - console.log(timelineContainer.scrollLeft); + } @@ -408,7 +328,6 @@ function createTimeline2() {
Schedule
-

${convertDateToText(getFirstDate,true)} - ${convertDateToText(getLastDate,true)}

@@ -423,8 +342,6 @@ function createTimeline2() {
` - - } function updateTable(){ diff --git a/marlo-web/src/main/webapp/global/images/end_date.png b/marlo-web/src/main/webapp/global/images/end_date.png new file mode 100644 index 0000000000000000000000000000000000000000..2a3bbbe5a80c1560c1f6b71cf8798cc87fbee4bf GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`j)FbFd;%$g$s6l5$8 za(7}_cTVOdki(Mh=j>gFVVpverLu6{1-oD!M-~5 literal 0 HcmV?d00001 diff --git a/marlo-web/src/main/webapp/global/images/start_date.png b/marlo-web/src/main/webapp/global/images/start_date.png new file mode 100644 index 0000000000000000000000000000000000000000..3bcc2a6e09a2b5213f465dfa812ad98e4e5a764e GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VXMsm#F#`j)FbFd;%$g$s6l5$8 za(7}_cTVOdki(Mh=`}4fX_j@C60&QUMboFyt=akR{0Nmz3WdHyG literal 0 HcmV?d00001 From 3db554a49fcd2e374a114ebce86bb3dafc3c3160 Mon Sep 17 00:00:00 2001 From: JhonSGIzquierdo Date: Thu, 21 Mar 2024 17:15:42 -0500 Subject: [PATCH 17/17] :wrench: chore(Timeline): date with african update --- marlo-web/src/main/webapp/crp/js/home/dashboard.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/marlo-web/src/main/webapp/crp/js/home/dashboard.js b/marlo-web/src/main/webapp/crp/js/home/dashboard.js index 651f942047..fd64c839e4 100644 --- a/marlo-web/src/main/webapp/crp/js/home/dashboard.js +++ b/marlo-web/src/main/webapp/crp/js/home/dashboard.js @@ -245,7 +245,7 @@ function createDivActivities(activity, id){ } const setStatus = (startDate, endDate) => { - const today = new Date(); + const today = convertDateToAfricanDate(new Date()); const dateStatus = { "Completed": today > new Date(endDate), "In progress": today > new Date(startDate) && today < new Date(endDate), @@ -276,8 +276,8 @@ function setWidth(amount) { } function setDistances(startDate,isToday, isJS) { - const today = new Date(); - today.setDate(today.getDate()-1); + const today = convertDateToAfricanDate(new Date()); + today.setDate(today.getDate()); let startofDay = new Date(today.getTime()); startofDay.setHours(0,0,0,0); const porcentOfDay = ((today.getTime() - startofDay.getTime()) / (1000*60*60*24))