@eso-status/forum-message 2.0.0-dev.7 → 2.0.0-dev.8

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.
@@ -53,6 +53,21 @@ export default class DateFormatter {
53
53
  * @private
54
54
  */
55
55
  private getRawHour;
56
+ /**
57
+ * Method to check if the time in parentheses is in UTC or not
58
+ * @private
59
+ */
60
+ private isUTCHour;
61
+ /**
62
+ * Method to retrieve the time when it is in UTC
63
+ * @private
64
+ */
65
+ private getRawUTCHour;
66
+ /**
67
+ * Method for retrieving the time when it is not in UTC
68
+ * @private
69
+ */
70
+ private getRawNoUTCHour;
56
71
  /**
57
72
  * Method for retrieving the minute number of the start time for case #1
58
73
  * @private
@@ -63,6 +78,21 @@ export default class DateFormatter {
63
78
  * @private
64
79
  */
65
80
  private getRawClassicHour2;
81
+ /**
82
+ * Method to check if the second time in parentheses is in UTC or not
83
+ * @private
84
+ */
85
+ private isUTCClassicHour2;
86
+ /**
87
+ * Method to retrieve the second time when it is in UTC
88
+ * @private
89
+ */
90
+ private getRawUTCClassicHour2;
91
+ /**
92
+ * Method to retrieve the second time when it is not in UTC
93
+ * @private
94
+ */
95
+ private getRawNoUTCClassicHour2;
66
96
  /**
67
97
  * Method for retrieving the minute number of the end time in case #1
68
98
  * @private
@@ -79,8 +79,33 @@ class DateFormatter {
79
79
  * @private
80
80
  */
81
81
  getRawHour() {
82
+ if (this.isUTCHour()) {
83
+ return this.getRawUTCHour();
84
+ }
85
+ return this.getRawNoUTCHour();
86
+ }
87
+ /**
88
+ * Method to check if the time in parentheses is in UTC or not
89
+ * @private
90
+ */
91
+ isUTCHour() {
92
+ return (this.rawDate.split(' UTC)').length === 3 ||
93
+ this.rawDate.split(' UTC)').length === 2);
94
+ }
95
+ /**
96
+ * Method to retrieve the time when it is in UTC
97
+ * @private
98
+ */
99
+ getRawUTCHour() {
82
100
  return Number(this.rawDate.split('(')[1].split(':')[0]);
83
101
  }
102
+ /**
103
+ * Method for retrieving the time when it is not in UTC
104
+ * @private
105
+ */
106
+ getRawNoUTCHour() {
107
+ return Number(this.rawDate.split(':')[0].split(', ')[1]);
108
+ }
84
109
  /**
85
110
  * Method for retrieving the minute number of the start time for case #1
86
111
  * @private
@@ -93,8 +118,32 @@ class DateFormatter {
93
118
  * @private
94
119
  */
95
120
  getRawClassicHour2() {
121
+ if (this.isUTCClassicHour2()) {
122
+ return this.getRawUTCClassicHour2();
123
+ }
124
+ return this.getRawNoUTCClassicHour2();
125
+ }
126
+ /**
127
+ * Method to check if the second time in parentheses is in UTC or not
128
+ * @private
129
+ */
130
+ isUTCClassicHour2() {
131
+ return this.rawDate.split(' UTC)').length === 3;
132
+ }
133
+ /**
134
+ * Method to retrieve the second time when it is in UTC
135
+ * @private
136
+ */
137
+ getRawUTCClassicHour2() {
96
138
  return Number(this.rawDate.split('(')[2].split(':')[0]);
97
139
  }
140
+ /**
141
+ * Method to retrieve the second time when it is not in UTC
142
+ * @private
143
+ */
144
+ getRawNoUTCClassicHour2() {
145
+ return Number(this.rawDate.split(' - ')[1].split(':')[0]);
146
+ }
98
147
  /**
99
148
  * Method for retrieving the minute number of the end time in case #1
100
149
  * @private
@@ -70,6 +70,7 @@ class SlugIdentifier {
70
70
  */
71
71
  this.ServerXboxEuMatchesList = [
72
72
  'Xbox: NA and EU megaservers for',
73
+ 'Xbox: EU megaserver for',
73
74
  ];
74
75
  /**
75
76
  * List of indicators proving that the announcement pertains to the slug server_xbox_na
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Different statuses of announcements indicating that the announcement refers to a service/server that is not functioning properly
3
+ */
4
+ export type RemoteIssuesRawStatus = 'is currently experiencing a service interruption';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=remoteIssuesRawStatus.type.js.map
@@ -5,7 +5,8 @@ import { RemoteServerPsEuRawSlug } from './remoteServerPsEuRawSlug.type';
5
5
  import { RemoteServerXboxEuRawSlug } from './remoteServerXboxEuRawSlug.type';
6
6
  import { RemoteServiceStoreEsoRawSlug } from './remoteServiceStoreEsoRawSlug.type';
7
7
  import { RemoteServiceWebSiteRawSlug } from './remoteServiceWebSiteRawSlug.type';
8
+ import { RemoteServerXboxNaRawSlug } from './remoteServerXboxNaRawSlug.type';
8
9
  /**
9
10
  * Different slugs of announcements
10
11
  */
11
- export type RemoteRawSlug = RemoteServerPcEuRawSlug | RemoteServerPcNaRawSlug | RemoteServerPcPtsRawSlug | RemoteServerPsEuRawSlug | RemoteServerXboxEuRawSlug | RemoteServiceStoreEsoRawSlug | RemoteServiceWebSiteRawSlug;
12
+ export type RemoteRawSlug = RemoteServerPcEuRawSlug | RemoteServerPcNaRawSlug | RemoteServerPcPtsRawSlug | RemoteServerPsEuRawSlug | RemoteServerXboxEuRawSlug | RemoteServerXboxNaRawSlug | RemoteServiceStoreEsoRawSlug | RemoteServiceWebSiteRawSlug;
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Different slugs of announcements concerning the European Xbox Megaserver
3
3
  */
4
- export type RemoteServerXboxEuRawSlug = 'Xbox: NA and EU megaservers for';
4
+ export type RemoteServerXboxEuRawSlug = 'Xbox: NA and EU megaservers for' | 'Xbox: EU megaserver for';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eso-status/forum-message",
3
- "version": "2.0.0-dev.7",
3
+ "version": "2.0.0-dev.8",
4
4
  "description": "Library for retrieving and formatting data, available at https://forums.elderscrollsonline.com or https://forums.elderscrollsonline.com/en/categories/pts",
5
5
  "author": "@dov118 <contact@dov118.dev> (https://dov118.dev)",
6
6
  "main": "lib/index.js",
@@ -19,6 +19,8 @@
19
19
  "lib/type/messageType.type.js",
20
20
  "lib/type/remoteDownRawStatus.type.d.ts",
21
21
  "lib/type/remoteDownRawStatus.type.js",
22
+ "lib/type/remoteIssuesRawStatus.type.d.ts",
23
+ "lib/type/remoteIssuesRawStatus.type.js",
22
24
  "lib/type/remotePlannedRawStatus.type.d.ts",
23
25
  "lib/type/remotePlannedRawStatus.type.js",
24
26
  "lib/type/remoteRawSlug.type.d.ts",