Skip to content

Commit 3cfed64

Browse files
committed
yesterday radio not working
Signed-off-by: Vedansh Saini <[email protected]>
1 parent 2bf0e18 commit 3cfed64

File tree

2 files changed

+54
-31
lines changed

2 files changed

+54
-31
lines changed

src/popup.html

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,45 @@
1414
height: 600px !important;
1515
max-height: 600px !important;
1616
overflow-y: scroll;
17+
background: #eae4e4;
1718
}
1819
</style>
1920
</head>
2021
<body>
21-
<div class="pl-4 py-4 rounded-2xl bg-cyan-400">
22-
<div class="flex justify-between py-2">
23-
<h3 class="text-3xl font-semibold ">Scrum Helper</h3>
24-
<img src="../icons/night-mode.png" alt="Night Mode" class="w-7 h-7 mx-3">
25-
</div>
26-
<div>
27-
<p class="font-semibold">SCRUM helper prefills the Scrums in google groups, with your FOSSASIA's contributions.</p>
28-
</div>
29-
30-
<!-- Change from here -->
31-
<div class="row center">
32-
<div class="switch">
33-
<label>
34-
Disable
35-
<input type="checkbox" id="enable">
36-
<span class="lever"></span>
37-
Enable
38-
</label>
22+
<div class="pl-2 py-4 rounded-2xl">
23+
<div class="bg-yellow-100 pl-4 rounded-3xl">
24+
<div class="flex justify-between py-2">
25+
<h3 class="text-3xl font-semibold ">Scrum Helper</h3>
26+
<img src="../icons/night-mode.png" alt="Night Mode" class="w-7 h-7 mx-3">
27+
</div>
28+
<div>
29+
<p class="font-semibold">SCRUM helper prefills the Scrums in google groups, with your FOSSASIA's contributions.</p>
30+
</div>
31+
32+
<!-- Change from here -->
33+
<div class="row center">
34+
<div class="switch">
35+
<label>
36+
Disable
37+
<input type="checkbox" id="enable">
38+
<span class="lever"></span>
39+
Enable
40+
</label>
41+
</div>
3942
</div>
40-
</div>
41-
<div class="row">
42-
<div class="col s12">
43-
<ul class="tabs">
44-
<li class="tab col s6" title="I am doing CodeHeat!"><a id="codeheatTab" href="#codeheatBox">CodeHeat</a></li>
45-
<li class="tab col s6" title="I am doing GSoC!"><a id="gsocTab" href="#gsocBox">GSoC</a></li>
46-
</ul>
43+
<div class="row">
44+
<div class="col s12">
45+
<ul class="tabs">
46+
<li class="tab col s6" title="I am doing CodeHeat!"><a id="codeheatTab" href="#codeheatBox">CodeHeat</a></li>
47+
<li class="tab col s6" title="I am doing GSoC!"><a id="gsocTab" href="#gsocBox">GSoC</a></li>
48+
</ul>
49+
</div>
4750
</div>
4851
</div>
49-
52+
5053
<!-- Till here -->
51-
<div class="bg-yellow-100 rounded-2xl">
52-
<div class=" border-gray-100 border-2 bg-white rounded-3xl px-4 py-2 mx-2 my-2">
54+
<div class="rounded-2xl">
55+
<div class=" border-gray-100 border-2 bg-white rounded-3xl pl-4 py-2 mx-2 my-2">
5356
<div>
5457
<h4>Your Project Name</h4>
5558
<input id="projectName" type="text" class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 my-2" placeholder="Enter your project name">
@@ -127,7 +130,7 @@ <h4 class="font-semibold text-xl">Note:</h4>
127130
</div>
128131

129132
<hr class="border-t-2 border-black">
130-
<div class="flex items-center justify-center text-xl">
133+
<div class="flex items-center mb-0 justify-center text-xl">
131134
<a target="_blank" href="https://github.com/fossasia/scrum_helper" class="flex items-center"><h6><i class="fa fa-github" aria-hidden="true"></i> view code</h6></a>
132135
</div>
133136
</div>

src/scripts/scrumHelper.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function allIncluded(outputTarget = 'email') {
1414
var reviewedPrsArray = [];
1515
var githubIssuesData = null;
1616
var lastWeekContribution = false;
17+
var yesterday = false;
1718
var githubPrsReviewData = null;
1819
var githubUserData = null;
1920
var githubPrsReviewDataProcessed = {};
@@ -44,6 +45,7 @@ function allIncluded(outputTarget = 'email') {
4445
'showOpenLabel',
4546
'showClosedLabel',
4647
'lastWeekContribution',
48+
'yesterday',
4749
'userReason',
4850
'gsoc',
4951
],
@@ -58,13 +60,17 @@ function allIncluded(outputTarget = 'email') {
5860
lastWeekContribution = true;
5961
handleLastWeekContributionChange();
6062
}
63+
if (items.yesterday){
64+
yesterday = true;
65+
handleYesterdayChange();
66+
}
6167
if (!items.enableToggle) {
6268
enableToggle = items.enableToggle;
6369
}
64-
if (items.endingDate && !lastWeekContribution) {
70+
if (items.endingDate && !lastWeekContribution && !yesterday) {
6571
endingDate = items.endingDate;
6672
}
67-
if (items.startingDate && !lastWeekContribution) {
73+
if (items.startingDate && !lastWeekContribution && !yesterday) {
6874
startingDate = items.startingDate;
6975
}
7076
if (items.githubUsername) {
@@ -111,6 +117,10 @@ function allIncluded(outputTarget = 'email') {
111117
endingDate = getToday();
112118
startingDate = getLastWeek();
113119
}
120+
function handleYesterdayChange() {
121+
endingDate = getToday();
122+
startingDate = getYesterday();
123+
}
114124
function getLastWeek() {
115125
var today = new Date();
116126
var noDays_to_goback = gsoc == 0 ? 7 : 1;
@@ -140,6 +150,16 @@ function allIncluded(outputTarget = 'email') {
140150
('00' + WeekDay.toString()).slice(-2);
141151
return WeekDisplayPadded;
142152
}
153+
function getYesterday() {
154+
var today = new Date();
155+
var noDays_to_goback = 1;
156+
var yesterday = new Date(today.getFullYear(), today.getMonth(), today.getDate() - noDays_to_goback);
157+
var yesterdayMonth = yesterday.getMonth() + 1;
158+
var yesterdayDay = yesterday.getDate();
159+
var yesterdayYear = yesterday.getFullYear();
160+
var yesterdayDisplayPadded = ('0000' + yesterdayYear.toString()).slice(-4)+ '-' + ('00' + yesterdayMonth.toString()).slice(-2) + '-' + ('00' + yesterdayDay.toString()).slice(-2);
161+
return yesterdayDisplayPadded;
162+
}
143163
// fetch github data
144164
function fetchGithubData() {
145165
var issueUrl = 'https://api.github.com/search/issues?q=author%3A' +

0 commit comments

Comments
 (0)