Skip to content

Commit 03fc17f

Browse files
authored
fix the date interval in the scrumHelper (Fixes#36) (#40)
* fix the date interval in the scrumHelper * changed date format
1 parent 851d9e7 commit 03fc17f

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/scripts/scrumHelper.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ function allIncluded(){
144144
});
145145
}
146146

147+
function formatDate(dateString) {
148+
const date = new Date(dateString);
149+
const options = { day: '2-digit', month: 'short', year: 'numeric' };
150+
return date.toLocaleDateString('en-US', options);
151+
}
152+
147153
//load initial text in scrum body
148154
function writeScrumBody(){
149155
if(!enableToggle)
@@ -163,12 +169,22 @@ function allIncluded(){
163169
nextWeekUl+="</ul>";
164170
var weekOrDay = gsoc==1?"yesterday":"last week";
165171
var weekOrDay2= gsoc==1?"today":"this week";
166-
scrumBody.innerHTML="<b>1. What did I do "+weekOrDay+"?</b>\
172+
if(lastWeekContribution==true){
173+
scrumBody.innerHTML="<b>1. What did I do "+weekOrDay+"?</b>\
174+
<br>"+lastWeekUl+"<br><br>\
175+
<b>2. What I plan to do "+weekOrDay2+"?</b>\
176+
<br>"+nextWeekUl+"<br><br>\
177+
<b>3. What is stopping me from doing my work?</b>\
178+
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+userReason+"</p>";
179+
}
180+
else{
181+
scrumBody.innerHTML="<b>1. What did I do from "+formatDate(startingDate)+" to "+formatDate(endingDate)+"?</b>\
167182
<br>"+lastWeekUl+"<br><br>\
168183
<b>2. What I plan to do "+weekOrDay2+"?</b>\
169184
<br>"+nextWeekUl+"<br><br>\
170185
<b>3. What is stopping me from doing my work?</b>\
171186
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+userReason+"</p>";
187+
}
172188
scrumBody.dispatchEvent(new Event("paste", { bubbles: true }));
173189
});
174190
}

0 commit comments

Comments
 (0)