@tailgatefantasysports/seasonservice 0.4.15 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SeasonService.js +1 -19
- package/app.config.js +1 -1
- package/package.json +1 -1
package/SeasonService.js
CHANGED
|
@@ -87,29 +87,11 @@ module.exports = class SeasonService {
|
|
|
87
87
|
newFrame = frame;
|
|
88
88
|
while (newFrame && newFrame.season === season) {
|
|
89
89
|
full[newFrame.type] = newFrame;
|
|
90
|
-
newFrame = this.
|
|
90
|
+
newFrame = this.getPreviousSeason(new Date(newFrame.start - 1))
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
return full;
|
|
94
94
|
}
|
|
95
|
-
getPreviousFullSeason(date) {
|
|
96
|
-
let frame = this.getPreviousSeason(date);
|
|
97
|
-
if (!frame)
|
|
98
|
-
return null
|
|
99
|
-
|
|
100
|
-
const seasons = {};
|
|
101
|
-
const previousFull = this.timeframes[parseInt(frame.season)];
|
|
102
|
-
for (let seasonType in previousFull) {
|
|
103
|
-
seasons[seasonType] = {
|
|
104
|
-
season: frame.season,
|
|
105
|
-
type: parseInt(seasonType),
|
|
106
|
-
start: previousFull[seasonType].start,
|
|
107
|
-
end: previousFull[seasonType].end,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
return seasons;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
95
|
|
|
114
96
|
/**
|
|
115
97
|
* Walks to a nearby season from date in direction
|
package/app.config.js
CHANGED