@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.
- package/lib/formatter/date.formatter.d.ts +30 -0
- package/lib/formatter/date.formatter.js +49 -0
- package/lib/identifier/slug.identifier.js +1 -0
- package/lib/type/remoteIssuesRawStatus.type.d.ts +4 -0
- package/lib/type/remoteIssuesRawStatus.type.js +3 -0
- package/lib/type/remoteRawSlug.type.d.ts +2 -1
- package/lib/type/remoteServerXboxEuRawSlug.type.d.ts +1 -1
- package/package.json +3 -1
|
@@ -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
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eso-status/forum-message",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
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",
|