warframe-worldstate-parser 4.3.1 → 4.4.0
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/lib/models/Calendar.js
CHANGED
|
@@ -45,7 +45,11 @@ export default class Calendar {
|
|
|
45
45
|
this.expiry = parseDate(calendar.Expiry);
|
|
46
46
|
|
|
47
47
|
this.days = Array.isArray(calendar.Days)
|
|
48
|
-
? calendar.Days.filter(Boolean).map((d) => ({
|
|
48
|
+
? calendar.Days.filter(Boolean).map((d) => ({
|
|
49
|
+
...d,
|
|
50
|
+
date: this.getDate(d.day).toISOString(),
|
|
51
|
+
events: d.events.map((e) => new DayEvent(e)),
|
|
52
|
+
}))
|
|
49
53
|
: [];
|
|
50
54
|
|
|
51
55
|
this.season = translateSeason(calendar.Season);
|
|
@@ -56,4 +60,15 @@ export default class Calendar {
|
|
|
56
60
|
|
|
57
61
|
this.requirements = calendar.UpgradeAvaliabilityRequirements;
|
|
58
62
|
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Converts number of day to a date in 1999 in UTC
|
|
66
|
+
* @param {number} day number of the day in a year
|
|
67
|
+
* @returns {Date} the date in 1999
|
|
68
|
+
*/
|
|
69
|
+
getDate(day) {
|
|
70
|
+
const date = new Date(Date.UTC(1999));
|
|
71
|
+
date.setUTCDate(date.getUTCDate() + day - 1);
|
|
72
|
+
return date;
|
|
73
|
+
}
|
|
59
74
|
}
|
package/package.json
CHANGED
|
@@ -7,4 +7,10 @@ export default class Calendar {
|
|
|
7
7
|
yearIteration: any;
|
|
8
8
|
version: any;
|
|
9
9
|
requirements: any;
|
|
10
|
+
/**
|
|
11
|
+
* Converts number of day to a date in 1999 in UTC
|
|
12
|
+
* @param {number} day number of the day in a year
|
|
13
|
+
* @returns {Date} the date in 1999
|
|
14
|
+
*/
|
|
15
|
+
getDate(day: number): Date;
|
|
10
16
|
}
|