@@ -14,6 +14,7 @@ function allIncluded(outputTarget = 'email') {
14
14
var reviewedPrsArray = [ ] ;
15
15
var githubIssuesData = null ;
16
16
var lastWeekContribution = false ;
17
+ var yesterday = false ;
17
18
var githubPrsReviewData = null ;
18
19
var githubUserData = null ;
19
20
var githubPrsReviewDataProcessed = { } ;
@@ -44,6 +45,7 @@ function allIncluded(outputTarget = 'email') {
44
45
'showOpenLabel' ,
45
46
'showClosedLabel' ,
46
47
'lastWeekContribution' ,
48
+ 'yesterday' ,
47
49
'userReason' ,
48
50
'gsoc' ,
49
51
] ,
@@ -58,13 +60,17 @@ function allIncluded(outputTarget = 'email') {
58
60
lastWeekContribution = true ;
59
61
handleLastWeekContributionChange ( ) ;
60
62
}
63
+ if ( items . yesterday ) {
64
+ yesterday = true ;
65
+ handleYesterdayChange ( ) ;
66
+ }
61
67
if ( ! items . enableToggle ) {
62
68
enableToggle = items . enableToggle ;
63
69
}
64
- if ( items . endingDate && ! lastWeekContribution ) {
70
+ if ( items . endingDate && ! lastWeekContribution && ! yesterday ) {
65
71
endingDate = items . endingDate ;
66
72
}
67
- if ( items . startingDate && ! lastWeekContribution ) {
73
+ if ( items . startingDate && ! lastWeekContribution && ! yesterday ) {
68
74
startingDate = items . startingDate ;
69
75
}
70
76
if ( items . githubUsername ) {
@@ -111,6 +117,10 @@ function allIncluded(outputTarget = 'email') {
111
117
endingDate = getToday ( ) ;
112
118
startingDate = getLastWeek ( ) ;
113
119
}
120
+ function handleYesterdayChange ( ) {
121
+ endingDate = getToday ( ) ;
122
+ startingDate = getYesterday ( ) ;
123
+ }
114
124
function getLastWeek ( ) {
115
125
var today = new Date ( ) ;
116
126
var noDays_to_goback = gsoc == 0 ? 7 : 1 ;
@@ -140,6 +150,16 @@ function allIncluded(outputTarget = 'email') {
140
150
( '00' + WeekDay . toString ( ) ) . slice ( - 2 ) ;
141
151
return WeekDisplayPadded ;
142
152
}
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
+ }
143
163
// fetch github data
144
164
function fetchGithubData ( ) {
145
165
var issueUrl = 'https://api.github.com/search/issues?q=author%3A' +
0 commit comments