signalk-to-noforeignland 0.1.14 → 0.1.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.
Files changed (2) hide show
  1. package/index.js +7 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -406,10 +406,13 @@ module.exports = function (app) {
406
406
  if (line) {
407
407
  try {
408
408
  const point = JSON.parse(line);
409
- if (isValidLatitude(point.lat) && isValidLongitude(point.lon)) {
410
- track.push([point.t,point.lat, point.lon])
411
- lastTimestamp = point.t
412
- }
409
+
410
+ const timestamp = new Date(point.t).getTime();
411
+ if (!isNaN(timestamp) && isValidLatitude(point.lat) && isValidLongitude(point.lon)) {
412
+ track.push([timestamp, point.lat, point.lon]);
413
+ lastTimestamp = timestamp;
414
+ }
415
+
413
416
  } catch (error) {
414
417
  app.debug('could not parse line from track file:', line);
415
418
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signalk-to-noforeignland",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "SignalK track logger to noforeignland.com ",
5
5
  "main": "index.js",
6
6
  "keywords": [