atmosx-nwws-parser 1.0.185 → 1.0.1852
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/package.json +1 -1
- package/src/events.js +4 -2
package/package.json
CHANGED
package/src/events.js
CHANGED
|
@@ -165,6 +165,7 @@ class NoaaWeatherWireServiceEvents {
|
|
|
165
165
|
let getThreat = loader.packages.mText.getString(msg, `DAMAGE THREAT...`);
|
|
166
166
|
let timeIssued = loader.packages.mText.getString(msg, `ISSUED TIME...`);
|
|
167
167
|
if (timeIssued == null) { timeIssued = stanza.attributes.issue; }
|
|
168
|
+
if (timeIssued == null) { new Date().toISOString(); }
|
|
168
169
|
let senderOffice = loader.packages.mText.getOffice(msg) || vtec.tracking.split(`-`)[0];
|
|
169
170
|
let getCoordinates = loader.packages.mText.getPolygonCoordinates(msg);
|
|
170
171
|
let getDescription = loader.packages.mText.getCleanDescription(msg, vtec);
|
|
@@ -173,7 +174,7 @@ class NoaaWeatherWireServiceEvents {
|
|
|
173
174
|
id: `Wire-${vtec.tracking}`,
|
|
174
175
|
tracking: vtec.tracking,
|
|
175
176
|
action: vtec.status,
|
|
176
|
-
history: [{description: getDescription, action: vtec.status, issued: timeIssued}],
|
|
177
|
+
history: [{description: getDescription, action: vtec.status, issued: new Date(timeIssued) == `Invalid Date` ? new Date(timeIssued) : timeIssued}],
|
|
177
178
|
properties: {
|
|
178
179
|
areaDesc: mUgc.locations.join(`; `) || `N/A`,
|
|
179
180
|
expires: new Date(vtec.expires) == `Invalid Date` ? new Date(9999, 0, 1) : new Date(vtec.expires),
|
|
@@ -233,12 +234,13 @@ class NoaaWeatherWireServiceEvents {
|
|
|
233
234
|
let getDescription = loader.packages.mText.getCleanDescription(msg, null);
|
|
234
235
|
let timeIssued = loader.packages.mText.getString(msg, `ISSUED TIME...`);
|
|
235
236
|
if (timeIssued == null) { timeIssued = stanza.attributes.issue; }
|
|
237
|
+
if (timeIssued == null) { new Date().toISOString(); }
|
|
236
238
|
let alert = {
|
|
237
239
|
hitch: `${new Date().getTime() - startTime}ms`,
|
|
238
240
|
id: `Wire-${defaultWMO ? defaultWMO[0] : `N/A`}-${mUgc.zones.join(`-`)}`,
|
|
239
241
|
tracking: `${defaultWMO ? defaultWMO[0] : `N/A`}-${mUgc.zones.join(`-`)}`,
|
|
240
242
|
action: `Issued`,
|
|
241
|
-
history: [{description: getDescription, action: `Issued`, issued: timeIssued}],
|
|
243
|
+
history: [{description: getDescription, action: `Issued`, issued: new Date(timeIssued) == `Invalid Date` ? new Date(timeIssued) : timeIssued}],
|
|
242
244
|
properties: {
|
|
243
245
|
areaDesc: mUgc.locations.join(`; `) || `N/A`,
|
|
244
246
|
expires: new Date(new Date(timeIssued).getTime() + 1 * 60 * 60 * 1000),
|