@tailgatefantasysports/seasonservice 0.4.13 → 0.4.15
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 +19 -1
- package/app.config.js +3 -3
- package/package.json +1 -1
package/SeasonService.js
CHANGED
|
@@ -87,11 +87,29 @@ 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._getSeasonDirection(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
|
+
|
|
95
113
|
|
|
96
114
|
/**
|
|
97
115
|
* Walks to a nearby season from date in direction
|
package/app.config.js
CHANGED
|
@@ -67,11 +67,11 @@ module.exports = {
|
|
|
67
67
|
},
|
|
68
68
|
[types.regular]: {
|
|
69
69
|
start: new Date('2024-09-04T00:00:00Z'),
|
|
70
|
-
end: new Date('
|
|
70
|
+
end: new Date('2025-01-07T08:00:00Z'),
|
|
71
71
|
},
|
|
72
72
|
[types.postseason]: {
|
|
73
|
-
start: new Date('
|
|
74
|
-
end: new Date('
|
|
73
|
+
start: new Date('2025-01-09T08:00:00Z'),
|
|
74
|
+
end: new Date('2025-02-12T00:00:00Z'),
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|